Skip to content

Instantly share code, notes, and snippets.

@alanc
alanc / dlmalloc.c
Created February 1, 2019 23:51
How to tell which library a function is from
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
void *sym;
Dl_info_t dlip;
sym = dlsym(RTLD_PROBE, "malloc");
@alanc
alanc / SRU39-man-page-changes.diff
Last active November 16, 2021 22:42
Man page changes in Solaris 11.4.39
diff -NurbBw 11.4.36/man1/auths.1 11.4.39/man1/auths.1
--- 11.4.36/man1/auths.1 2021-11-16 13:14:11.672647261 +0000
+++ 11.4.39/man1/auths.1 2021-11-16 13:14:46.532630672 +0000
@@ -18,28 +18,26 @@
auths check [-u user] authorization
- auths add [-S repository] -t description
- [-h help_file_path] authorization
+ auths add [-S repository] -t description authorization
@alanc
alanc / SRU36-man-page-changes.diff
Last active August 28, 2021 00:44
Man page changes in Solaris 11.4.36
diff -Nurwb 11.4.33/man1/adb.1 11.4.36/man1/adb.1
--- 11.4.33/man1/adb.1 2021-08-27 10:45:35.028195964 +0000
+++ 11.4.36/man1/adb.1 2021-08-27 10:46:36.300766164 +0000
@@ -17,7 +17,7 @@
The adb utility is implemented as a link to the mdb(1) utility. mdb is
a low-level debugging utility that can be used to examine user pro-
cesses as well as the live operating system or operating system crash
- dumps. The mdb utility provides complete backwards compatibility with
+ dumps. The mdb utility provides complete backward compatibility with
the existing syntax and features of adb, including support for process-

Keybase proof

I hereby claim:

  • I am alanc on github.
  • I am acoopersmith (https://keybase.io/acoopersmith) on keybase.
  • I have a public key ASCTM--5EC4sHyTAJOrzFXoUW3CGAo5ZWYfafFiyv2mh5Ao

To claim this, I am signing this object:

@alanc
alanc / bug-list.txt
Created May 19, 2021 23:31
Man page changes in Solaris 11.4.33
Man page changes between Solaris 11.4.30 & 11.4.33, including changes for:
15607354 /usr/bin/awk should be mediated and default to nawk
15621143 SUNBT6924356 Virtio drivers for KVM
15756594 resolv.conf(5) manpage needs examples
20875258 RAD TLS should support client X.509 certs
20875332 RAD TLS should Identify and Authenticate user via X.509 certficate
21227539 memcntl(MC_LOCK_GRANULE) can return EAGAIN, contrary to manpage
21971253 Steer developers towards getaddrinfo and getnameinfo
27848134 Deferred dump: publicly document the off switch so customer can choose
@alanc
alanc / gist:8645efc262f736dd84015e64ea89bdad
Created February 17, 2021 02:20
Man page changes I made in Solaris 11.4.30 (11.4 SRU 30)
- Formatting, spelling, and typo fixes across many pages
- Remove less useful / add more useful "See Also" entries in several pages
- Use &ldquo; &rdquo; in HTML output instead of nroff-style ``quotes''
- Replace remaining historical "Solaris Operating Environment" references
with "Solaris Operating System"
- calendar(1):
- Mention LDAP as name service, not just NIS
- cat(1):
- Remove duplicated text in example
@alanc
alanc / ps.1.txt
Created January 13, 2021 00:01
Solaris 11.4.27 ps(1) man page
ps(1) User Commands ps(1)
NAME
ps - report process status
SYNOPSIS
ps [-aAcdefHjlLPwWyZ] [-C cmdlist] [-g pgrplist|grouplist]
[-h|--lgroup lgrplist] [-n namelist] [-o|--format format]...
@alanc
alanc / gist:977ee7cc8a7aa81cd5f52b71644edc45
Created July 18, 2019 18:38
closefrom() in Solaris 11.4
Oracle Corporation SunOS 5.11 11.4 June 2019
solaris% cd /tmp
solaris% cat > closefrom.c
#include <stdlib.h>
int main() {
closefrom(3);
}
solaris% cc -o closefrom closefrom.c
solaris% truss -u :: ./closefrom
.\" @(#)cstyle.ms 1.8 96/08/19 SMI
.ND 96/08/19
.RP
.TL
C Style and Coding Standards for SunOS
.br
.AU
Bill Shannon
.AI
Copyright \(co 1993 by Sun Microsystems, Inc.
@alanc
alanc / param-check.csh
Created August 18, 2018 17:19
Compare <parameter> tags listed in synopsis of SolBook man page with those in the body
mkdir /tmp/params
foreach f ( on/en/xman2/*xml on/en/xman3c/*xml )
echo "cat //synopsis/parameter" | xmllint --loaddtd --nonet --path /usr/share/xml/xsolbook \
--path /usr/share/xml/xsolbook/entities --path /usr/share/xml/xsolbook/entities/en --shell $f \
| perl -n -e 'print $1, "\n" if m{<parameter>(.*)</parameter>}' | sort -u > /tmp/params/${f:t}-syn
echo "cat //parameter" | xmllint --loaddtd --nonet --path /usr/share/xml/xsolbook --path \
/usr/share/xml/xsolbook/entities --path /usr/share/xml/xsolbook/entities/en --shell $f \
| perl -n -e 'print $1, "\n" if m{<parameter>(.*)</parameter>}' | sort -u > /tmp/params/${f:t}-all
diff -u /tmp/params/${f:t}-syn /tmp/params/${f:t}-all >> /tmp/params/diffs
end