<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#375EAB">

  <title>src/syscall/mksysnum_freebsd.pl - The Go Programming Language</title>

<link type="text/css" rel="stylesheet" href="https://golang.org/lib/godoc/style.css">

<link rel="search" type="application/opensearchdescription+xml" title="godoc" href="https://golang.org/opensearch.xml" />

<link rel="stylesheet" href="https://golang.org/lib/godoc/jquery.treeview.css">
<script type="text/javascript">window.initFuncs = [];</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(["_setAccount", "UA-11222381-2"]);
_gaq.push(["b._setAccount", "UA-49880327-6"]);
window.trackPageview = function() {
  _gaq.push(["_trackPageview", location.pathname+location.hash]);
  _gaq.push(["b._trackPageview", location.pathname+location.hash]);
};
window.trackPageview();
window.trackEvent = function(category, action, opt_label, opt_value, opt_noninteraction) {
  _gaq.push(["_trackEvent", category, action, opt_label, opt_value, opt_noninteraction]);
  _gaq.push(["b._trackEvent", category, action, opt_label, opt_value, opt_noninteraction]);
};
</script>
</head>
<body>

<div id='lowframe' style="position: fixed; bottom: 0; left: 0; height: 0; width: 100%; border-top: thin solid grey; background-color: white; overflow: auto;">
...
</div><!-- #lowframe -->

<div id="topbar" class="wide"><div class="container">
<div class="top-heading" id="heading-wide"><a href="https://golang.org/">The Go Programming Language</a></div>
<div class="top-heading" id="heading-narrow"><a href="https://golang.org/">Go</a></div>
<a href="mksysnum_freebsd.pl#" id="menu-button"><span id="menu-button-arrow">&#9661;</span></a>
<form method="GET" action="https://golang.org/search">
<div id="menu">
<a href="../../doc.1">Documents</a>
<a href="../../pkg.1">Packages</a>
<a href="https://golang.org/project/">The Project</a>
<a href="https://golang.org/help/">Help</a>

<a href="https://golang.org/blog/">Blog</a>


<a id="playgroundButton" href="../../play" title="Show Go Playground">Play</a>

<span class="search-box"><input type="search" id="search" name="q" placeholder="Search" aria-label="Search" required><button type="submit"><span><!-- magnifying glass: --><svg width="24" height="24" viewBox="0 0 24 24"><title>submit search</title><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/><path d="M0 0h24v24H0z" fill="none"/></svg></span></button></span>
</div>
</form>

</div></div>


<div id="playground" class="play">
	<div class="input"><textarea class="code" spellcheck="false">package main

import "fmt"

func main() {
	fmt.Println("Hello, 世界")
}</textarea></div>
	<div class="output"></div>
	<div class="buttons">
		<a class="run" title="Run this code [shift-enter]">Run</a>
		<a class="fmt" title="Format this code">Format</a>
		
		<a class="share" title="Share this code">Share</a>
		
	</div>
</div>


<div id="page" class="wide">
<div class="container">


  <h1>
    Text file
    <a href="../../src.1">src</a>/<a href="../syscall.1">syscall</a>/<span class="text-muted">mksysnum_freebsd.pl</span>
  </h1>





  <h2>
    Documentation: <a href="../../pkg/syscall.1">syscall</a>
  </h2>



<div id="nav"></div>


<pre><span id="L1" class="ln">     1</span>	#!/usr/bin/env perl
<span id="L2" class="ln">     2</span>	# Copyright 2009 The Go Authors. All rights reserved.
<span id="L3" class="ln">     3</span>	# Use of this source code is governed by a BSD-style
<span id="L4" class="ln">     4</span>	# license that can be found in the LICENSE file.
<span id="L5" class="ln">     5</span>	#
<span id="L6" class="ln">     6</span>	# Generate system call table for FreeBSD from master list
<span id="L7" class="ln">     7</span>	# (for example, /usr/src/sys/kern/syscalls.master).
<span id="L8" class="ln">     8</span>	
<span id="L9" class="ln">     9</span>	use strict;
<span id="L10" class="ln">    10</span>	
<span id="L11" class="ln">    11</span>	my $command = &#34;mksysnum_freebsd.pl &#34; . join(&#39; &#39;, @ARGV);
<span id="L12" class="ln">    12</span>	
<span id="L13" class="ln">    13</span>	print &lt;&lt;EOF;
<span id="L14" class="ln">    14</span>	// $command
<span id="L15" class="ln">    15</span>	// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
<span id="L16" class="ln">    16</span>	
<span id="L17" class="ln">    17</span>	package syscall
<span id="L18" class="ln">    18</span>	
<span id="L19" class="ln">    19</span>	const (
<span id="L20" class="ln">    20</span>	EOF
<span id="L21" class="ln">    21</span>	
<span id="L22" class="ln">    22</span>	while(&lt;&gt;){
<span id="L23" class="ln">    23</span>		if(/^([0-9]+)\s+\S+\s+STD\s+({ \S+\s+(\w+).*)$/){
<span id="L24" class="ln">    24</span>			my $num = $1;
<span id="L25" class="ln">    25</span>			my $proto = $2;
<span id="L26" class="ln">    26</span>			my $name = &#34;SYS_$3&#34;;
<span id="L27" class="ln">    27</span>			$name =~ y/a-z/A-Z/;
<span id="L28" class="ln">    28</span>	
<span id="L29" class="ln">    29</span>			# There are multiple entries for enosys and nosys, so comment them out.
<span id="L30" class="ln">    30</span>			if($name =~ /^SYS_E?NOSYS$/){
<span id="L31" class="ln">    31</span>				$name = &#34;// $name&#34;;
<span id="L32" class="ln">    32</span>			}
<span id="L33" class="ln">    33</span>			if($name eq &#39;SYS_SYS_EXIT&#39;){
<span id="L34" class="ln">    34</span>				$name = &#39;SYS_EXIT&#39;;
<span id="L35" class="ln">    35</span>			}
<span id="L36" class="ln">    36</span>			if($name =~ /^SYS_CAP_+/ || $name =~ /^SYS___CAP_+/){
<span id="L37" class="ln">    37</span>				next
<span id="L38" class="ln">    38</span>			}
<span id="L39" class="ln">    39</span>	
<span id="L40" class="ln">    40</span>			print &#34;	$name = $num;  // $proto\n&#34;;
<span id="L41" class="ln">    41</span>	
<span id="L42" class="ln">    42</span>			# We keep Capsicum syscall numbers for FreeBSD
<span id="L43" class="ln">    43</span>			# 9-STABLE here because we are not sure whether they
<span id="L44" class="ln">    44</span>			# are mature and stable.
<span id="L45" class="ln">    45</span>			if($num == 513){
<span id="L46" class="ln">    46</span>				print &#34; SYS_CAP_NEW = 514 // { int cap_new(int fd, uint64_t rights); }\n&#34;;
<span id="L47" class="ln">    47</span>				print &#34; SYS_CAP_GETRIGHTS = 515 // { int cap_getrights(int fd, \\\n&#34;;
<span id="L48" class="ln">    48</span>				print &#34; SYS_CAP_ENTER = 516 // { int cap_enter(void); }\n&#34;;
<span id="L49" class="ln">    49</span>				print &#34; SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); }\n&#34;;
<span id="L50" class="ln">    50</span>			}
<span id="L51" class="ln">    51</span>		}
<span id="L52" class="ln">    52</span>	}
<span id="L53" class="ln">    53</span>	
<span id="L54" class="ln">    54</span>	print &lt;&lt;EOF;
<span id="L55" class="ln">    55</span>	)
<span id="L56" class="ln">    56</span>	EOF
</pre><p><a href="https://golang.org/src/syscall/mksysnum_freebsd.pl?m=text">View as plain text</a></p>

<div id="footer">
Build version go1.10.<br>
Except as <a href="https://developers.google.com/site-policies#restrictions">noted</a>,
the content of this page is licensed under the
Creative Commons Attribution 3.0 License,
and code is licensed under a <a href="https://golang.org/LICENSE">BSD license</a>.<br>
<a href="https://golang.org/doc/tos.html">Terms of Service</a> |
<a href="http://www.google.com/intl/en/policies/privacy/">Privacy Policy</a>
</div>

</div><!-- .container -->
</div><!-- #page -->

<!-- TODO(adonovan): load these from <head> using "defer" attribute? -->
<script type="text/javascript" src="https://golang.org/lib/godoc/jquery.js"></script>
<script type="text/javascript" src="https://golang.org/lib/godoc/jquery.treeview.js"></script>
<script type="text/javascript" src="https://golang.org/lib/godoc/jquery.treeview.edit.js"></script>


<script type="text/javascript" src="https://golang.org/lib/godoc/playground.js"></script>

<script>var goVersion = "go1.10";</script>
<script type="text/javascript" src="https://golang.org/lib/godoc/godocs.js"></script>

<script type="text/javascript">
(function() {
  var ga = document.createElement("script"); ga.type = "text/javascript"; ga.async = true;
  ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";
  var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>

