]> sourceware.org Git - newlib-cygwin.git/blob - winsup/doc/utils.xml
Cygwin: Add --nokill dumper option
[newlib-cygwin.git] / winsup / doc / utils.xml
1 <?xml version="1.0" encoding='UTF-8'?>
2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
4
5 <sect1 id="using-utils">
6 <title>Cygwin Utilities</title>
7
8 <para>Cygwin comes with a number of command-line utilities that are used to
9 manage the UNIX emulation portion of the Cygwin environment. While many of
10 these reflect their UNIX counterparts, each was written specifically for
11 Cygwin. You may use the long or short option names interchangeably; for
12 example, <literal>--help</literal> and <literal>-h</literal> function
13 identically. All of the Cygwin command-line utilities support the
14 <literal>--help</literal> and <literal>--version</literal> options. </para>
15
16 <refentry id="chattr">
17 <refmeta>
18 <refentrytitle>chattr</refentrytitle>
19 <manvolnum>1</manvolnum>
20 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
21 </refmeta>
22
23 <refnamediv>
24 <refname>chattr</refname>
25 <refpurpose>Change file attributes</refpurpose>
26 </refnamediv>
27
28 <refsynopsisdiv>
29 <screen>
30 chattr [-RVfhv] [+-=mode]... [file]...
31 </screen>
32 </refsynopsisdiv>
33
34 <refsect1 id="chattr-options">
35 <title>Options</title>
36 <screen>
37 -R, --recursive recursively list attributes of directories and their
38 contents
39 -V, --verbose Be verbose during operation
40 -f, --force suppress error messages
41 -h, --help this help text
42 -v, --version display the program version
43 </screen>
44 </refsect1>
45
46 <refsect1 id="chattr-desc">
47 <title>Description</title>
48 <para>The <command>chattr</command> program allows to change file
49 attributes, namely DOS attributes, as well as making files sparse,
50 encrypt or compress them on FS level, or setting directories'
51 case sensitivity.
52 </para>
53
54 <para>The format of 'mode' is {+-=}[acCehnrsSt]</para>
55
56 <para>The operator '+' causes the selected attributes to be added to the
57 existing attributes of the files; '-' causes them to be removed; and
58 '=' causes them to be the only attributes that the files have.</para>
59
60 <para>Supported attributes:</para>
61
62 <screen>
63 'r', 'Readonly': file is read-only
64 'h', 'Hidden': file or directory is hidden
65 's', 'System': file or directory that the operating system uses
66 'a', 'Archive': file or directory has the archive marker set
67 't', 'Temporary': file is being used for temporary storage
68 'S', 'Sparse': file is sparse
69 'c', 'Compressed': file or directory is compressed
70 'n', 'Notindexed': file or directory is not to be indexed by the
71 content indexing service
72 'e', 'Encrypted': file is encrypted
73 'C', 'Casesensitive': directory is handled case sensitive
74 (Windows 10 1803 or later, local NTFS only,
75 WSL must be installed)
76 </screen>
77 </refsect1>
78 </refentry>
79
80 <refentry id="cygcheck">
81 <refmeta>
82 <refentrytitle>cygcheck</refentrytitle>
83 <manvolnum>1</manvolnum>
84 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
85 </refmeta>
86
87 <refnamediv>
88 <refname>cygcheck</refname>
89 <refpurpose>List system information, check installed packages, or query package database</refpurpose>
90 </refnamediv>
91
92 <refsynopsisdiv>
93 <screen>
94 cygcheck [-v] [-h] PROGRAM
95 cygcheck -c [-d] [PACKAGE]
96 cygcheck -s [-r] [-v] [-h]
97 cygcheck -k
98 cygcheck -f FILE [FILE]...
99 cygcheck -l [PACKAGE]...
100 cygcheck -p REGEXP
101 cygcheck --delete-orphaned-installation-keys
102 cygcheck -h
103 </screen>
104 </refsynopsisdiv>
105
106 <refsect1 id="cygcheck-options">
107 <title>Options</title>
108 <screen>
109 At least one command option or a PROGRAM is required, as shown above.
110
111 PROGRAM list library (DLL) dependencies of PROGRAM
112 -c, --check-setup show installed version of PACKAGE and verify integrity
113 (or for all installed packages if none specified)
114 -d, --dump-only just list packages, do not verify (with -c)
115 -s, --sysinfo produce diagnostic system information (implies -c -d)
116 -r, --registry also scan registry for Cygwin settings (with -s)
117 -k, --keycheck perform a keyboard check session (must be run from a
118 plain console only, not from a pty/rxvt/xterm)
119 -f, --find-package find the package to which FILE belongs
120 -l, --list-package list contents of PACKAGE (or all packages if none given)
121 -p, --package-query search for REGEXP in the entire cygwin.com package
122 repository (requires internet connectivity)
123 --delete-orphaned-installation-keys
124 Delete installation keys of old, now unused
125 installations from the registry. Requires the right
126 to change the registry.
127 -v, --verbose produce more verbose output
128 -h, --help annotate output with explanatory comments when given
129 with another command, otherwise print this help
130 -V, --version print the version of cygcheck and exit
131
132 Note: -c, -f, and -l only report on packages that are currently installed. To
133 search all official Cygwin packages use -p instead. The -p REGEXP matches
134 package names, descriptions, and names of files/paths within all packages.
135 </screen>
136 </refsect1>
137
138 <refsect1 id="cygcheck-desc">
139 <title>Description</title>
140 <para> The <command>cygcheck</command> program is a diagnostic utility for
141 dealing with Cygwin programs. If you are familiar with
142 <command>dpkg</command> or <command>rpm</command>,
143 <command>cygcheck</command> is similar in many ways. (The major
144 difference is that <command>setup.exe</command> handles installing and
145 uninstalling packages; see <xref linkend="internet-setup"/> for more
146 information.) </para>
147 <para> The <literal>-c</literal> option checks the version and status of
148 installed Cygwin packages. If you specify one or more package names,
149 <command>cygcheck</command> will limit its output to those packages, or
150 with no arguments it lists all packages. A package will be marked
151 <literal>Incomplete</literal> if files originally installed are no longer
152 present. The best thing to do in that situation is reinstall the package
153 with <command>setup.exe</command>. To see which files are missing, use
154 the <literal>-v</literal> option. If you do not need to know the status
155 of each package and want <command>cygcheck</command> to run faster, add
156 the <literal>-d</literal> option and <command>cygcheck</command> will
157 only output the name and version for each package. </para>
158 <para> If you list one or more programs on the command line,
159 <command>cygcheck</command> will diagnose the runtime environment of that
160 program or programs, providing the names of DLL files on which the
161 program depends. If you specify the <literal>-s</literal> option,
162 <command>cygcheck</command> will give general system information. If you
163 list one or more programs on the command line and specify
164 <literal>-s</literal>, <command>cygcheck</command> will report on
165 both.</para>
166 <para> The <literal>-f</literal> option helps you to track down which
167 package a file came from, and <literal>-l</literal> lists all files in a
168 package. For example, to find out about
169 <filename>/usr/bin/less</filename> and its package:
170 </para>
171
172 <example
173 id="utils-cygcheck-ex"><title>Example <command>cygcheck</command>
174 usage</title>
175 <screen>
176 $ cygcheck -f /usr/bin/less
177 less-381-1
178
179 $ cygcheck -l less
180 /usr/bin/less.exe
181 /usr/bin/lessecho.exe
182 /usr/bin/lesskey.exe
183 /usr/man/man1/less.1
184 /usr/man/man1/lesskey.1
185 </screen>
186 </example>
187
188 <para>The <literal>-h</literal> option prints additional helpful messages
189 in the report, at the beginning of each section. It also adds table
190 column headings. While this is useful information, it also adds some to
191 the size of the report, so if you want a compact report or if you know
192 what everything is already, just leave this out.</para>
193
194 <para>The <literal>-v</literal> option causes the output to be more
195 verbose. What this means is that additional information will be reported
196 which is usually not interesting, such as the internal version numbers of
197 DLLs, additional information about recursive DLL usage, and if a file in
198 one directory in the PATH also occurs in other directories on the PATH. </para>
199
200 <para>The <literal>-r</literal> option causes <command>cygcheck</command>
201 to search your registry for information that is relevant to Cygwin
202 programs. These registry entries are the ones that have "Cygwin" in the
203 name. If you are paranoid about privacy, you may remove information from
204 this report, but please keep in mind that doing so makes it harder to
205 diagnose your problems.</para>
206
207 <para>In contrast to the other options that search the packages that are
208 installed on your local system, the <literal>-p</literal> option can be
209 used to search the entire official Cygwin package repository. It takes as
210 argument a Perl-compatible regular expression which is used to match
211 package names, package descriptions, and path/filenames of the contents
212 of packages. This feature requires an active internet connection, since
213 it must query the <literal>cygwin.com</literal> web site. In fact, it is
214 equivalent to the search that is available on the <ulink
215 url="https://cygwin.com/packages/">Cygwin package listing</ulink>
216 page.</para>
217
218 <para>For example, perhaps you are getting an error because you are missing
219 a certain DLL and you want to know which package includes that file:
220 </para>
221
222 <example id="utils-search-ex"><title>Searching all packages for a
223 file</title>
224 <screen>
225 $ cygcheck -p 'cygintl-2\.dll'
226 Found 1 matches for 'cygintl-2\.dll'.
227
228 libintl2-0.12.1-3 GNU Internationalization runtime library
229
230 $ cygcheck -p 'libexpat.*\.a'
231 Found 2 matches for 'libexpat.*\.a'.
232
233 expat-1.95.7-1 XML parser library written in C
234 expat-1.95.8-1 XML parser library written in C
235
236 $ cygcheck -p '/ls\.exe'
237 Found 2 matches for '/ls\.exe'.
238
239 coreutils-5.2.1-5 GNU core utilities (includes fileutils, sh-utils and textutils)
240 coreutils-5.3.0-6 GNU core utilities (includes fileutils, sh-utils and textutils)
241 </screen>
242 </example>
243
244 <para>Note that this option takes a regular expression, not a glob or
245 wildcard. This means that you need to use <literal>.*</literal> if you
246 want something similar to the wildcard <literal>*</literal> commonly used
247 in filename globbing. Similarly, to match the period character you should
248 use <literal>\.</literal> since the <literal>.</literal> character in a
249 regexp is a metacharacter that will match any character. Also be aware
250 that the characters such as <literal>\</literal> and <literal>*</literal>
251 are shell metacharacters, so they must be either escaped or quoted, as in
252 the example above.</para>
253
254 <para>The third example above illustrates that if you want to match a whole
255 filename, you should include the <literal>/</literal> path seperator. In
256 the given example this ensures that filenames that happen to end in
257 <literal>ls.exe</literal> such as <literal>ncftpls.exe</literal> are not
258 shown. Note that this use does not mean "look for packages with
259 <literal>ls</literal> in the root directory," since the
260 <literal>/</literal> can match anywhere in the path. It's just there to
261 anchor the match so that it matches a full filename.</para>
262
263 <para>By default the matching is case-sensitive. To get a case insensitive
264 match, begin your regexp with <literal>(?i)</literal> which is a
265 PCRE-specific feature. For complete documentation on Perl-compatible
266 regular expression syntax and options, read the <command>perlre</command>
267 manpage, or one of many websites such as <literal>perldoc.com</literal>
268 that document the Perl language.</para>
269
270 <para>The <command>cygcheck</command> program should be used to send
271 information about your system for troubleshooting when requested. When
272 asked to run this command save the output so that you can email it, for
273 example:</para>
274
275 <screen>
276 <prompt>$</prompt> <userinput>cygcheck -s -v -r -h &gt; cygcheck_output.txt</userinput>
277 </screen>
278
279 <para> Each Cygwin DLL stores its path and installation key in the
280 registry. This allows troubleshooting of problems which could be a result
281 of having multiple concurrent Cygwin installations. However, if you're
282 experimenting a lot with different Cygwin installation paths, your
283 registry could accumulate a lot of old Cygwin installation entries for
284 which the installation doesn't exist anymore. To get rid of these
285 orphaned registry entries, use the <command>cygcheck
286 --delete-orphaned-installation-keys</command> command.</para>
287 </refsect1>
288
289 </refentry>
290
291 <refentry id="cygpath">
292 <refmeta>
293 <refentrytitle>cygpath</refentrytitle>
294 <manvolnum>1</manvolnum>
295 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
296 </refmeta>
297
298 <refnamediv>
299 <refname>cygpath</refname>
300 <refpurpose>Convert Unix and Windows format paths, or output system path information</refpurpose>
301 </refnamediv>
302
303 <refsynopsisdiv>
304 <screen>
305 cygpath (-d|-m|-u|-w|-t TYPE) [-f FILE] [OPTION]... NAME...
306 cygpath [-c HANDLE]
307 cygpath [-ADHOPSW]
308 cygpath [-F ID]
309 </screen>
310 </refsynopsisdiv>
311
312 <refsect1 id="cygpath-options">
313 <title>Options</title>
314 <screen>
315 Output type options:
316
317 -d, --dos print DOS (short) form of NAMEs (C:\PROGRA~1\)
318 -m, --mixed like --windows, but with regular slashes (C:/WINNT)
319 -M, --mode report on mode of file (currently binmode or textmode)
320 -u, --unix (default) print Unix form of NAMEs (/cygdrive/c/winnt)
321 -w, --windows print Windows form of NAMEs (C:\WINNT)
322 -t, --type TYPE print TYPE form: 'dos', 'mixed', 'unix', or 'windows'
323
324 Path conversion options:
325
326 -a, --absolute output absolute path
327 -l, --long-name print Windows long form of NAMEs (with -w, -m only)
328 -p, --path NAME is a PATH list (i.e., '/bin:/usr/bin')
329 -U, --proc-cygdrive Emit /proc/cygdrive path instead of cygdrive prefix
330 when converting Windows path to UNIX path.
331 -s, --short-name print DOS (short) form of NAMEs (with -w, -m only)
332 -C, --codepage CP print DOS, Windows, or mixed pathname in Windows
333 codepage CP. CP can be a numeric codepage identifier,
334 or one of the reserved words ANSI, OEM, or UTF8.
335 If this option is missing, cygpath defaults to the
336 character set defined by the current locale.
337
338 System information:
339
340 -A, --allusers use `All Users' instead of current user for -D, -P
341 -D, --desktop output `Desktop' directory and exit
342 -H, --homeroot output `Profiles' directory (home root) and exit
343 -O, --mydocs output `My Documents' directory and exit
344 -P, --smprograms output Start Menu `Programs' directory and exit
345 -S, --sysdir output system directory and exit
346 -W, --windir output `Windows' directory and exit
347 -F, --folder ID output special folder with numeric ID and exit
348
349 Other options:
350
351 -f, --file FILE read FILE for input; use - to read from STDIN
352 -o, --option read options from FILE as well (for use with --file)
353 -c, --close HANDLE close HANDLE (for use in captured process)
354 -i, --ignore ignore missing argument
355 -h, --help output usage information and exit
356 -V, --version output version information and exit
357 </screen>
358 </refsect1>
359
360 <refsect1 id="cygpath-desc">
361 <title>Description</title>
362 <para>The <command>cygpath</command> program is a utility that converts
363 Windows native filenames to Cygwin POSIX-style pathnames and vice versa.
364 It can be used when a Cygwin program needs to pass a file name to a
365 native Windows program, or expects to get a file name from a native
366 Windows program. Alternatively, <command>cygpath</command> can output
367 information about the location of important system directories in either
368 format. </para>
369
370 <para>The <literal>-u</literal> and <literal>-w</literal> options indicate
371 whether you want a conversion to UNIX (POSIX) format
372 (<literal>-u</literal>) or to Windows format (<literal>-w</literal>). Use
373 the <literal>-d</literal> to get DOS-style (8.3) file and path names. The
374 <literal>-m</literal> option will output Windows-style format but with
375 forward slashes instead of backslashes. This option is especially useful
376 in shell scripts, which use backslashes as an escape character.</para>
377
378 <para> In combination with the <literal>-w</literal> option, you can use
379 the <literal>-l</literal> and <literal>-s</literal> options to use normal
380 (long) or DOS-style (short) form. The <literal>-d</literal> option is
381 identical to <literal>-w</literal> and <literal>-s</literal> together. </para>
382
383 <para>The <literal>-C</literal> option allows to specify a Windows codepage
384 to print DOS and Windows paths created with one of the
385 <literal>-d</literal>, <literal>-m</literal>, or <literal>-w</literal>
386 options. The default is to use the character set of the current locale
387 defined by one of the internationalization environment variables
388 <envar>LC_ALL</envar>, <envar>LC_CTYPE</envar>, or <envar>LANG</envar>,
389 see <xref linkend="setup-locale"/>. This is sometimes not sufficient for
390 interaction with native Windows tools, which might expect native,
391 non-ASCII characters in a specific Windows codepage. Console tools, for
392 instance, might expect pathnames in the current OEM codepage, while
393 graphical tools like Windows Explorer might expect pathnames in the
394 current ANSI codepage.</para>
395
396 <para>The <literal>-U</literal> option allows to use cygpath to create
397 unambiguous Unix paths pointing outside the Cygwin tree andf thus having
398 no explicit POSIX path. Those paths usually use the cygdrive prefix.
399 However, the cygdrive prefix can be changed by the user, so symbolic links
400 created using the cygdrive prefix are not foolproof. With
401 <literal>-U</literal> cygpath will generate such paths prepended by the
402 virtual <filename>/proc/cygdrive</filename> symbolic link, which will
403 never change, so the created path is safe against changing the cygdrive
404 prefix.</para>
405
406 <para>The <literal>-C</literal> option takes a single parameter:</para>
407 <itemizedlist spacing="compact">
408 <listitem>
409 <para><literal>ANSI</literal>, to specify the current ANSI
410 codepage</para>
411 </listitem>
412 <listitem>
413 <para><literal>OEM</literal>, to specify the current OEM (console)
414 codepage</para>
415 </listitem>
416 <listitem>
417 <para><literal>UTF8</literal>, to specify UTF-8.</para>
418 </listitem>
419 <listitem>
420 <para>A numerical, decimal codepage number, for instance 936 for GBK,
421 28593 for ISO-8859-3, etc. A full list of supported codepages is
422 listed on the Microsoft MSDN page <ulink
423 url="http://msdn.microsoft.com/en-us/library/dd317756(VS.85).aspx"
424 >Code Page Identifiers</ulink>. A codepage of 0 is the same as if the
425 <literal>-C</literal> hasn't been specified at all.</para>
426 </listitem>
427 </itemizedlist>
428
429 <para>The <literal>-p</literal> option means that you want to convert a
430 path-style string rather than a single filename. For example, the PATH
431 environment variable is semicolon-delimited in Windows, but
432 colon-delimited in UNIX. By giving <literal>-p</literal> you are
433 instructing <command>cygpath</command> to convert between these
434 formats.</para>
435
436 <para>The <literal>-i</literal> option supresses the print out of the usage
437 message if no filename argument was given. It can be used in make file
438 rules converting variables that may be omitted to a proper format. Note
439 that <command>cygpath</command> output may contain spaces (C:\Program
440 Files) so should be enclosed in quotes. </para>
441
442
443 <example id="utils-cygpath-ex">
444 <title>Example <command>cygpath</command> usage</title>
445 <screen>
446 <![CDATA[
447 #!/bin/sh
448 if [ "${1}" = "" ];
449 then
450 XPATH=".";
451 else
452 XPATH="$(cygpath -C ANSI -w "${1}")";
453 fi
454 explorer $XPATH &
455 ]]>
456 </screen>
457 </example>
458
459 <para>The capital options <literal>-D</literal>, <literal>-H</literal>,
460 <literal>-P</literal>, <literal>-S</literal>, and <literal>-W</literal>
461 output directories used by Windows that are not the same on all systems,
462 for example <literal>-S</literal> might output C:\WINNT\system32 or
463 C:\Windows\System32. The <literal>-H</literal> shows the Windows profiles
464 directory that can be used as root of home. The <literal>-A</literal>
465 option forces use of the "All Users" directories instead of the current
466 user for the <literal>-D</literal>, <literal>-O</literal> and
467 <literal>-P</literal> options. The <literal>-F</literal> outputs other
468 special folders specified by their internal numeric code (decimal or
469 0x-prefixed hex). For valid codes and symbolic names, see the CSIDL_*
470 definitions in the include file /usr/include/w32api/shlobj.h from package
471 w32api. The current valid range of codes for folders is 0 (Desktop) to 59
472 (CDBurn area). By default the output is in UNIX (POSIX) format; use the
473 <literal>-w</literal> or <literal>-d</literal> options to get other
474 formats.</para>
475 </refsect1>
476 </refentry>
477
478 <refentry id="dumper">
479 <refmeta>
480 <refentrytitle>dumper</refentrytitle>
481 <manvolnum>1</manvolnum>
482 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
483 </refmeta>
484
485 <refnamediv>
486 <refname>dumper</refname>
487 <refpurpose>Dump core from WIN32PID to FILENAME.core</refpurpose>
488 </refnamediv>
489
490 <refsynopsisdiv>
491 <screen>
492 dumper [OPTION] FILENAME WIN32PID
493 </screen>
494 </refsynopsisdiv>
495
496 <refsect1 id="dumper-options">
497 <title>Options</title>
498 <screen>
499 -n, --nokill don't terminate the dumped process
500 -d, --verbose be verbose while dumping
501 -h, --help output help information and exit
502 -q, --quiet be quiet while dumping (default)
503 -V, --version output version information and exit
504 </screen>
505 </refsect1>
506
507 <refsect1 id="dumper-desc">
508 <title>Description</title>
509 <para>The <command>dumper</command> utility can be used to create a core
510 dump of running Windows process. This core dump can be later loaded to
511 <command>gdb</command> and analyzed. One common way to use
512 <command>dumper</command> is to plug it into cygwin's Just-In-Time
513 debugging facility by adding
514 <screen>
515 error_start=x:\path\to\dumper.exe
516 </screen> to the
517 <emphasis>CYGWIN</emphasis> environment variable. Please note that
518 <literal>x:\path\to\dumper.exe</literal> is Windows-style and not cygwin
519 path. If <literal>error_start</literal> is set this way, then dumper will
520 be started whenever some program encounters a fatal error. </para>
521
522 <para> <command>dumper</command> can be also be started from the command
523 line to create a core dump of any running process.</para>
524
525 <para>For historical reasons, unless the <literal>-n</literal> option
526 is given, after the core dump is created and when the
527 <command>dumper</command> exits, the target process is also
528 terminated.</para>
529
530 <para> To save space in the core dump, <command>dumper</command> doesn't
531 write those portions of the target process's memory space that are loaded
532 from executable and dll files and are unchanged (e.g. program code).
533 Instead, <command>dumper</command> saves paths to the files which
534 contain that data. When a core dump is loaded into gdb, it uses these
535 paths to load the appropriate files. That means that if you create a core
536 dump on one machine and try to debug it on another, you'll need to place
537 identical copies of the executable and dlls in the same directories as on
538 the machine where the core dump was created. </para>
539 </refsect1>
540 </refentry>
541
542 <refentry id="getconf">
543 <refmeta>
544 <refentrytitle>getconf</refentrytitle>
545 <manvolnum>1</manvolnum>
546 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
547 </refmeta>
548
549 <refnamediv>
550 <refname>getconf</refname>
551 <refpurpose>Get configuration values</refpurpose>
552 </refnamediv>
553
554 <refsynopsisdiv>
555 <screen>
556 getconf [-v specification] variable_name [pathname]
557 getconf -a [pathname]
558 </screen>
559 </refsynopsisdiv>
560
561 <refsect1 id="getconf-options">
562 <title>Options</title>
563 <screen>
564 -v specification Indicate specific version for which configuration
565 values shall be fetched.
566 -a, --all Print all known configuration values
567
568 Other options:
569
570 -h, --help This text
571 -V, --version Print program version and exit
572 </screen>
573 </refsect1>
574
575 <refsect1 id="getconf-desc">
576 <title>Description</title>
577 <para>The <command>getconf</command> utility prints the value of the
578 configuration variable specified by <literal>variable_name</literal>. If
579 no <literal>pathname</literal> is given, <command>getconf</command>
580 serves as a wrapper for the <literal>confstr</literal> and
581 <literal>sysconf</literal> functions, supporting the symbolic constants
582 defined in the <literal>limits.h</literal> and
583 <literal>unistd.h</literal> headers, without their respective
584 <literal>_CS_</literal> or <literal>_SC_</literal> prefixes. </para>
585
586 <para>If <literal>pathname</literal> is given, <command>getconf</command>
587 prints the value of the configuration variable for the specified
588 pathname. In this form, <command>getconf</command> serves as a wrapper
589 for the <literal>pathconf</literal> function, supporting the symbolic
590 constants defined in the <literal>unistd.h</literal> header, without the
591 <literal>_PC_</literal> prefix. </para>
592
593 <para>If you specify the <literal>-v</literal> option, the parameter
594 denotes a specification for which the value of the configuration variable
595 should be printed. Note that the only specifications supported by Cygwin
596 are <literal>POSIX_V7_ILP32_OFFBIG</literal> and the legacy
597 <literal>POSIX_V6_ILP32_OFFBIG</literal> and
598 <literal>XBS5_ILP32_OFFBIG</literal> equivalents.</para>
599
600 <para>Use the <literal>-a</literal> option to print a list of all available
601 configuration variables for the system, or given
602 <literal>pathname</literal>, and their values.</para>
603 </refsect1>
604 </refentry>
605
606 <refentry id="getfacl">
607 <refmeta>
608 <refentrytitle>getfacl</refentrytitle>
609 <manvolnum>1</manvolnum>
610 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
611 </refmeta>
612
613 <refnamediv>
614 <refname>getfacl</refname>
615 <refpurpose>Display file and directory access control lists (ACLs)</refpurpose>
616 </refnamediv>
617
618 <refsynopsisdiv>
619 <screen>
620 getfacl [-adceEn] FILE [FILE2...]
621 </screen>
622 </refsynopsisdiv>
623
624 <refsect1 id="getfacl-options">
625 <title>Options</title>
626 <screen>
627 -a, --access display the file access control list only
628 -d, --default display the default access control list only
629 -c, --omit-header do not display the comment header
630 -e, --all-effective print all effective rights
631 -E, --no-effective print no effective rights
632 -n, --numeric print numeric user/group identifiers
633 -V, --version print version and exit
634 -h, --help this help text
635
636 When multiple files are specified on the command line, a blank
637 line separates the ACLs for each file.
638 </screen>
639 </refsect1>
640
641 <refsect1 id="getfacl-desc">
642 <title>Description</title>
643 <para> For each argument that is a regular file, special file or directory,
644 <command>getfacl</command> displays the owner, the group, and the ACL.
645 For directories <command>getfacl</command> displays additionally the
646 default ACL. With no options specified, <command>getfacl</command>
647 displays the filename, the owner, the group, the setuid (s), setgid (s),
648 and sticky (t) bits if available, and both the ACL and the default ACL,
649 if it exists. For more information on Cygwin and Windows ACLs, see
650 <xref linkend="ntsec"/> in the Cygwin User's Guide. The format
651 for ACL output is as follows:
652 <screen>
653 # file: filename
654 # owner: name or uid
655 # group: name or uid
656 # flags: sst
657 user::perm
658 user:name or uid:perm
659 group::perm
660 group:name or gid:perm
661 mask:perm
662 other:perm
663 default:user::perm
664 default:user:name or uid:perm
665 default:group::perm
666 default:group:name or gid:perm
667 default:mask:perm
668 default:other:perm
669 </screen>
670 </para>
671 </refsect1>
672 </refentry>
673
674 <refentry id="kill">
675 <refmeta>
676 <refentrytitle>kill</refentrytitle>
677 <manvolnum>1</manvolnum>
678 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
679 </refmeta>
680
681 <refnamediv>
682 <refname>kill</refname>
683 <refpurpose>Send signals to processes</refpurpose>
684 </refnamediv>
685
686 <refsynopsisdiv>
687 <screen>
688 kill [-f] [-signal] [-s signal] pid1 [pid2 ...]
689 kill -l [signal]
690 </screen>
691 </refsynopsisdiv>
692
693 <refsect1 id="kill-options">
694 <title>Options</title>
695 <screen>
696 -f, --force force, using win32 interface if necessary
697 -l, --list print a list of signal names
698 -s, --signal send signal (use kill --list for a list)
699 -W, --winpid specified pids are windows PIDs, not Cygwin PIDs
700 (use with extreme caution!)
701 -h, --help output usage information and exit
702 -V, --version output version information and exit
703 </screen>
704 </refsect1>
705
706 <refsect1 id="kill-desc">
707 <title>Description</title>
708 <para>The <command>kill</command> program allows you to send arbitrary
709 signals to other Cygwin programs. The usual purpose is to end a running
710 program from some other window when ^C won't work, but you can also send
711 program-specified signals such as SIGUSR1 to trigger actions within the
712 program, like enabling debugging or re-opening log files. Each program
713 defines the signals they understand.</para>
714
715 <para>You may need to specify the full path to use <command>kill</command>
716 from within some shells, including <command>bash</command>, the default
717 Cygwin shell. This is because <command>bash</command> defines a
718 <command>kill</command> builtin function; see the <command>bash</command>
719 man page under <emphasis>BUILTIN COMMANDS</emphasis> for more
720 information. To make sure you are using the Cygwin version, try
721 <screen>
722 $ /bin/kill --version
723 </screen> which should give the Cygwin
724 <command>kill</command> version number and copyright information. </para>
725
726 <para>The <literal>-f</literal> option uses Windows functions to
727 terminate processes forcefully. Use <literal>-f</literal> to
728 terminate native Windows processes not started by Cygwin processes.
729 <literal>-f</literal> can also be useful to terminate Cygwin processes
730 not answering to SIGKILL.</para>
731
732 <para>Unless you specific the <literal>-W</literal> option, the "pid"
733 values used by <command>kill</command> are the Cygwin pids, not the
734 Windows pids. To get a list of running programs and their Cygwin pids,
735 use the Cygwin <command>ps</command> program. <command>ps -W</command>
736 will display <emphasis>all</emphasis> windows pids.</para>
737
738 <para>The <command>kill -l</command> option prints the name of the given
739 signal, or a list of all signal names if no signal is given.</para>
740
741 <para>To send a specific signal, use the <literal>-signN</literal> option,
742 either with a signal number or a signal name (minus the "SIG" part), as
743 shown in these examples:</para>
744
745 <example id="utils-kill-ex">
746 <title>Using the kill command</title>
747 <screen>
748 <prompt>$</prompt> <userinput>kill 123</userinput>
749 <prompt>$</prompt> <userinput>kill -1 123</userinput>
750 <prompt>$</prompt> <userinput>kill -HUP 123</userinput>
751 <prompt>$</prompt> <userinput>kill -f 123</userinput>
752 </screen>
753 </example>
754
755 <para>Here is a list of available signals, their numbers, and some
756 commentary on them, from the file
757 <literal>&lt;sys/signal.h&gt;</literal>, which should be considered the
758 official source of this information.</para>
759
760 <screen>
761 SIGHUP 1 hangup
762 SIGINT 2 interrupt
763 SIGQUIT 3 quit
764 SIGILL 4 illegal instruction (not reset when caught)
765 SIGTRAP 5 trace trap (not reset when caught)
766 SIGABRT 6 used by abort
767 SIGIOT 6 another name for SIGABRT
768 SIGEMT 7 EMT instruction
769 SIGFPE 8 floating point exception
770 SIGKILL 9 kill (cannot be caught or ignored)
771 SIGBUS 10 bus error
772 SIGSEGV 11 segmentation violation
773 SIGSYS 12 bad argument to system call
774 SIGPIPE 13 write on a pipe with no one to read it
775 SIGALRM 14 alarm clock
776 SIGTERM 15 software termination signal from kill
777 SIGURG 16 urgent condition on IO channel
778 SIGSTOP 17 sendable stop signal not from tty
779 SIGTSTP 18 stop signal from tty
780 SIGCONT 19 continue a stopped process
781 SIGCHLD 20 to parent on child stop or exit
782 SIGCLD 20 System V name for SIGCHLD
783 SIGTTIN 21 to readers pgrp upon background tty read
784 SIGTTOU 22 like TTIN for output if (tp-&gt;t_local&amp;LTOSTOP)
785 SIGIO 23 input/output possible
786 SIGPOLL 23 System V name for SIGIO
787 SIGXCPU 24 exceeded CPU time limit
788 SIGXFSZ 25 exceeded file size limit
789 SIGVTALRM 26 virtual time alarm
790 SIGPROF 27 profiling time alarm
791 SIGWINCH 28 window changed
792 SIGLOST 29 resource lost (eg, record-lock lost)
793 SIGPWR 29 power failure
794 SIGUSR1 30 user defined signal 1
795 SIGUSR2 31 user defined signal 2
796 </screen>
797 </refsect1>
798 </refentry>
799
800 <refentry id="ldd">
801 <refmeta>
802 <refentrytitle>ldd</refentrytitle>
803 <manvolnum>1</manvolnum>
804 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
805 </refmeta>
806
807 <refnamediv>
808 <refname>ldd</refname>
809 <refpurpose>Print shared library dependencies</refpurpose>
810 </refnamediv>
811
812 <refsynopsisdiv>
813 <screen>
814 ldd [OPTION]... FILE...
815 </screen>
816 </refsynopsisdiv>
817
818 <refsect1 id="ldd-options">
819 <title>Options</title>
820 <screen>
821 -h, --help print this help and exit
822 -V, --version print version information and exit
823 -r, --function-relocs process data and function relocations
824 (currently unimplemented)
825 -u, --unused print unused direct dependencies
826 (currently unimplemented)
827 -v, --verbose print all information
828 (currently unimplemented)
829 </screen>
830 </refsect1>
831
832 <refsect1 id="ldd-desc">
833 <title>Description</title>
834 <para><command>ldd</command> prints the shared libraries (DLLs) loaded
835 when running an executable or DLL.</para>
836
837 <refsect2 id="ldd-desc-security">
838 <title>Security</title>
839 <para>
840 <command>ldd</command> invokes the Windows loader on the file specified,
841 then uses the Windows debugging interface to report DLLs loaded, and
842 (for executables) to attempt to stop execution before the entrypoint.
843 Thus, you should never use ldd on an untrusted file.
844 </para>
845 </refsect2>
846 </refsect1>
847
848 </refentry>
849
850 <refentry id="locale">
851 <refmeta>
852 <refentrytitle>locale</refentrytitle>
853 <manvolnum>1</manvolnum>
854 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
855 </refmeta>
856
857 <refnamediv>
858 <refname>locale</refname>
859 <refpurpose>Get locale-specific information</refpurpose>
860 </refnamediv>
861
862 <refsynopsisdiv>
863 <screen>
864 locale [-amvhV]
865 locale [-ck] NAME
866 locale [-iusfnU]
867 </screen>
868 </refsynopsisdiv>
869
870 <refsect1 id="locale-options">
871 <title>Options</title>
872 <screen>
873 System information:
874
875 -a, --all-locales List all available supported locales
876 -m, --charmaps List all available character maps
877 -v, --verbose More verbose output
878
879 Modify output format:
880
881 -c, --category-name List information about given category NAME
882 -k, --keyword-name Print information about given keyword NAME
883
884 Default locale information:
885
886 -i, --input Print current input locale
887 -u, --user Print locale of user's default UI language
888 -s, --system Print locale of system default UI language
889 -f, --format Print locale of user's regional format settings
890 (time, numeric &amp; monetary)
891 -n, --no-unicode Print system default locale for non-Unicode programs
892 -U, --utf Attach \".UTF-8\" to the result
893
894 Other options:
895
896 -h, --help This text
897 -V, --version Print program version and exit
898 </screen>
899 </refsect1>
900
901 <refsect1 id="locale-desc">
902 <title>Description</title>
903 <para><command>locale</command> without parameters prints information about
904 the current locale environment settings.</para>
905
906 <para>The <literal>-i</literal>, <literal>-u</literal>,
907 <literal>-s</literal>, <literal>-f</literal>, and <literal>-n</literal>
908 options can be used to request the various Windows locale settings. The
909 purpose is to use this command in scripts to set the POSIX locale
910 variables.</para>
911
912 <para>The <literal>-i</literal> option prints the current input language.
913 This is called the "Input language" and basically equivalent to the
914 current keyboard layout setting.</para>
915
916 <para>The <literal>-u</literal> option prints the current user's Windows UI
917 locale to stdout. In Windows this setting is called the
918 "Display Language".</para>
919
920 <para>The <literal>-s</literal> option prints the systems default instead.
921 </para>
922
923 <para>The <literal>-f</literal> option prints the user's setting for time,
924 date, number and currency. That's equivalent to the setting in the
925 "Formats" or "Regional Options" tab in the "Region and Language" or
926 "Regional and Language Options" dialog.</para>
927
928 <para>The <literal>-n</literal> option prints the system's default
929 language used for applications which don't support Unicode.</para>
930
931 <para>With the <literal>-U</literal> option <command>locale</command>
932 appends the string ".UTF-8" to enforce using UTF-8. Using UTF-8
933 as codeset is recommended.</para>
934
935 <para>Usage example:</para>
936
937 <screen>
938 bash$ export LANG=$(locale -uU)
939 bash$ echo $LANG
940 en_US.UTF-8
941 bash$ export LC_TIME=$(locale -fU)
942 bash$ echo $LC_TIME
943 de_DE.UTF-8
944 </screen>
945
946 <para>The <literal>-a</literal> option is helpful to learn which locales
947 are supported by your Windows machine. It prints all available locales
948 and the allowed modifiers. Example:</para>
949
950 <screen>
951 bash$ locale -a
952 C
953 C.utf8
954 POSIX
955 af_ZA
956 af_ZA.utf8
957 am_ET
958 am_ET.utf8
959 ...
960 be_BY
961 be_BY.utf8
962 be_BY@latin
963 ...
964 ca_ES
965 ca_ES.utf8
966 ca_ES@euro
967 catalan
968 ...
969 </screen>
970
971 <para>The <literal>-v</literal> option prints more detailed information
972 about each available locale. Example:</para>
973
974 <screen>
975 bash$ locale -av
976 locale: af_ZA archive: /cygdrive/c/Windows/system32/kernel32.dll
977 -------------------------------------------------------------------------------
978 language | Afrikaans
979 territory | South Africa
980 codeset | ISO-8859-1
981
982 locale: af_ZA.utf8 archive: /cygdrive/c/Windows/system32/kernel32.dll
983 -------------------------------------------------------------------------------
984 language | Afrikaans
985 territory | South Africa
986 codeset | UTF-8
987
988 ...
989
990 locale: ca_ES@euro archive: /cygdrive/c/Windows/system32/kernel32.dll
991 -------------------------------------------------------------------------------
992 language | Catalan
993 territory | Spain
994 codeset | ISO-8859-15
995
996 locale: catalan archive: /usr/share/locale/locale.alias
997 -------------------------------------------------------------------------------
998 language | Catalan
999 territory | Spain
1000 codeset | ISO-8859-1
1001
1002 ...
1003 </screen>
1004
1005 <para>The <literal>-m</literal> option prints the names of the available
1006 charmaps supported by Cygwin to stdout.</para>
1007
1008 <para>Otherwise, if arguments are given, <command>locale</command> prints
1009 the values assigned to these arguments. Arguments can be names of locale
1010 categories (for instance: LC_CTYPE, LC_MONETARY), or names of keywords
1011 supported in the locale categories (for instance: thousands_sep,
1012 charmap). The <literal>-c</literal> option prints additionally the name
1013 of the category. The <literal>-k</literal> option prints additionally the
1014 name of the keyword. Example:</para>
1015
1016 <screen>
1017 bash$ locale -ck LC_MESSAGES
1018 LC_MESSAGES
1019 yesexpr="^[yY]"
1020 noexpr="^[nN]"
1021 yesstr="yes"
1022 nostr="no"
1023 messages-codeset="UTF-8"
1024 bash$ locale noexpr
1025 ^[nN]
1026 </screen>
1027 </refsect1>
1028 </refentry>
1029
1030 <refentry id="lsattr">
1031 <refmeta>
1032 <refentrytitle>lsattr</refentrytitle>
1033 <manvolnum>1</manvolnum>
1034 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
1035 </refmeta>
1036
1037 <refnamediv>
1038 <refname>lsattr</refname>
1039 <refpurpose>List file attributes</refpurpose>
1040 </refnamediv>
1041
1042 <refsynopsisdiv>
1043 <screen>
1044 lsattr [-RVadhln] [file]...
1045 </screen>
1046 </refsynopsisdiv>
1047
1048 <refsect1 id="lsattr-options">
1049 <title>Options</title>
1050 <screen>
1051 -R, --recursive recursively list attributes of directories and their
1052 contents
1053 -V, --version display the program version
1054 -a, --all list all files in directories, including files that
1055 start with '.'
1056 -d, --directory list directories like other files, rather than listing
1057 their contents.
1058 -l, --long print options using long names instead of single
1059 character abbreviations
1060 -n, --no-headers don't print directory headers when recursing
1061 -h, --help this help text
1062 </screen>
1063 </refsect1>
1064
1065 <refsect1 id="lsattr-desc">
1066 <title>Description</title>
1067 <para>The <command>lsattr</command> program allows to list file
1068 attributes, namely DOS attributes, file sparseness, FS level
1069 encryption and compression state, as well as directories'
1070 case sensitivity setting.
1071 </para>
1072
1073 <para>Supported attributes:</para>
1074
1075 <screen>
1076 'r', 'Readonly': file is read-only, directory is system-marked
1077 'h', 'Hidden': file or directory is hidden
1078 's', 'System': file or directory that the operating system uses
1079 'a', 'Archive': file or directory has the archive marker set
1080 't', 'Temporary': file is being used for temporary storage
1081 'S', 'Sparse': file is sparse
1082 'r', 'Reparse': file or directory that has a reparse point
1083 'c', 'Compressed': file or directory is compressed
1084 'o', 'Offline': the data of a file is moved to offline storage
1085 'n', 'Notindexed': file or directory is not to be indexed by the
1086 content indexing service
1087 'e', 'Encrypted': file is encrypted
1088 'C', 'Casesensitive': directory is handled case sensitive
1089 (Windows 10 1803 or later, local NTFS only,
1090 WSL must be installed)
1091 </screen>
1092 </refsect1>
1093 </refentry>
1094
1095 <refentry id="minidumper">
1096 <refmeta>
1097 <refentrytitle>minidumper</refentrytitle>
1098 <manvolnum>1</manvolnum>
1099 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
1100 </refmeta>
1101
1102 <refnamediv>
1103 <refname>minidumper</refname>
1104 <refpurpose>Write minidump from WIN32PID to FILENAME.dmp</refpurpose>
1105 </refnamediv>
1106
1107 <refsynopsisdiv>
1108 <screen>
1109 minidumper [OPTION] FILENAME WIN32PID
1110 </screen>
1111 </refsynopsisdiv>
1112
1113 <refsect1 id="minidumper-options">
1114 <title>Options</title>
1115 <screen>
1116 -t, --type minidump type flags
1117 -n, --nokill don't terminate the dumped process
1118 -d, --verbose be verbose while dumping
1119 -h, --help output help information and exit
1120 -q, --quiet be quiet while dumping (default)
1121 -V, --version output version information and exit
1122 </screen>
1123 </refsect1>
1124
1125 <refsect1 id="minidumper-desc">
1126 <title>Description</title>
1127 <para>
1128 The <command>minidumper</command> utility can be used to create a
1129 minidump of a running Windows process. This minidump can be later
1130 analysed using breakpad or Windows debugging tools.
1131 </para>
1132
1133 <para>
1134 <command>minidumper</command> can be used with cygwin's Just-In-Time
1135 debugging facility in exactly the same way as <command>dumper</command>
1136 (See <xref linkend="dumper"></xref>).
1137 </para>
1138
1139 <para>
1140 <command>minidumper</command> can also be started from the command line to
1141 create a minidump of any running process. For compatibility with
1142 <command>dumper</command> the target process is terminated after dumping
1143 unless the <literal>-n</literal> option is given.
1144 </para>
1145 </refsect1>
1146 </refentry>
1147
1148 <refentry id="mkgroup">
1149 <refmeta>
1150 <refentrytitle>mkgroup</refentrytitle>
1151 <manvolnum>1</manvolnum>
1152 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
1153 </refmeta>
1154
1155 <refnamediv>
1156 <refname>mkgroup</refname>
1157 <refpurpose>Write /etc/group-like output to stdout</refpurpose>
1158 </refnamediv>
1159
1160 <refsynopsisdiv>
1161 <screen>
1162 mkgroup [OPTION]...
1163 </screen>
1164 </refsynopsisdiv>
1165
1166 <refsect1 id="mkgroup-options">
1167 <title>Options</title>
1168 <screen>
1169 Options:
1170
1171 -l,--local [machine] Print local group accounts of \"machine\",
1172 from local machine if no machine specified.
1173 Automatically adding machine prefix for local
1174 machine depends on settings in /etc/nsswitch.conf.
1175 -L,--Local machine Ditto, but generate groupname with machine prefix.
1176 -d,--domain [domain] Print domain groups,
1177 from current domain if no domain specified.
1178 -c,--current Print current group.
1179 -S,--separator char For -L use character char as domain\\group
1180 separator in groupname instead of default '+'.
1181 -o,--id-offset offset Change the default offset (0x10000) added to gids
1182 -g,--group groupname Only return information for the specified group.
1183 One of -l, -d must be specified, too.
1184 -b,--no-builtin Don't print BUILTIN groups.
1185 -U,--unix grouplist Print UNIX groups when using -l on a UNIX Samba
1186 server. Grouplist is a comma-separated list of
1187 groupnames or gid ranges (root,-25,50-100).
1188 Enumerating large ranges can take a long time!
1189 -h,--help Print this message.
1190 -v,--version Print version information and exit.
1191
1192 Default is to print local groups on stand-alone machines, plus domain
1193 groups on domain controllers and domain member machines.
1194 </screen>
1195 </refsect1>
1196
1197 <refsect1 id="mkgroup-desc">
1198 <title>Description</title>
1199 <para>Don't use this command to generate a local /etc/group file, unless you
1200 really need one. See the Cygwin User's Guide for more information.
1201 </para>
1202
1203 <para>The <command>mkgroup</command> program can be used to create a local
1204 <filename>/etc/group</filename> file. Cygwin doesn't need this file,
1205 because it reads group information from the Windows account databases,
1206 but you can add an <filename>/etc/group</filename> file for instance, if
1207 your machine is often disconnected from its domain controller.
1208 </para>
1209
1210 <para>Note that this information is static, in contrast to the information
1211 automatically gathered by Cygwin from the Windows account databases. If
1212 you change the group information on your system, you'll need to regenerate
1213 the group file for it to have the new information.</para>
1214
1215 <para>By default, the information generated by <command>mkgroup</command>
1216 is equivalent to the information generated by Cygwin itself. The
1217 <literal>-d</literal> and <literal>-l/-L</literal> options allow you to
1218 specify where the information comes from, some domain, or the local SAM
1219 of a machine. Note that you can only enumerate accounts from trusted
1220 domains. Any non-trusted domain will be ignored. Access-restrictions
1221 of your current account apply. The <literal>-l/-L</literal> when used
1222 with a machine name, tries to contact that machine to enumerate local
1223 groups of other machines, typically outside of domains. This scenario
1224 cannot be covered by Cygwin's account automatism. If you want to use
1225 the <literal>-L</literal> option, but you don't like the default
1226 domain/group separator from <filename>/etc/nsswitch.conf</filename>,
1227 you can specify another separator using the <literal>-S</literal> option,
1228 for instance:</para>
1229
1230 <example id="utils-mkgroup-ex">
1231 <title>Setting up group entry for current user with different
1232 domain/group separator</title>
1233 <screen>
1234 <prompt>$</prompt> <userinput>mkgroup -L server1 -S= &gt; /etc/group</userinput>
1235 </screen>
1236 </example>
1237
1238 <para>For very simple needs, an entry for the current user's group can be
1239 created by using the option <literal>-c</literal>.</para>
1240
1241 <para>The <literal>-o</literal> option allows for (unlikely) special cases
1242 with multiple machines where the GIDs might match otherwise. The
1243 <literal>-g</literal> option only prints the information for one group.
1244 The <literal>-U</literal> option allows you to enumerate the standard
1245 UNIX groups on a Samba machine. It's used together with <literal>-l
1246 samba-server</literal> or <literal>-L samba-server</literal>. The normal
1247 UNIX groups are usually not enumerated, but they can show up as a group
1248 in <command>ls -l</command> output. </para>
1249 </refsect1>
1250 </refentry>
1251
1252 <refentry id="mkpasswd">
1253 <refmeta>
1254 <refentrytitle>mkpasswd</refentrytitle>
1255 <manvolnum>1</manvolnum>
1256 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
1257 </refmeta>
1258
1259 <refnamediv>
1260 <refname>mkpasswd</refname>
1261 <refpurpose>Write /etc/passwd-like output to stdout</refpurpose>
1262 </refnamediv>
1263
1264 <refsynopsisdiv>
1265 <screen>
1266 mkpasswd [OPTIONS]...
1267 </screen>
1268 </refsynopsisdiv>
1269
1270 <refsect1 id="mkpasswd-options">
1271 <title>Options</title>
1272 <screen>
1273 Options:
1274
1275 -l,--local [machine] Print local user accounts of \"machine\",
1276 from local machine if no machine specified.
1277 Automatically adding machine prefix for local
1278 machine depends on settings in /etc/nsswitch.conf.
1279 -L,--Local machine Ditto, but generate username with machine prefix.
1280 -d,--domain [domain] Print domain accounts,
1281 from current domain if no domain specified.
1282 -c,--current Print current user.
1283 -S,--separator char For -L use character char as domain\\user
1284 separator in username instead of the default '+'.
1285 -o,--id-offset offset Change the default offset (0x10000) added to uids
1286 of foreign local machine accounts. Use with -l/-L.
1287 -u,--username username Only return information for the specified user.
1288 One of -l, -d must be specified, too
1289 -b,--no-builtin Don't print BUILTIN users.
1290 -p,--path-to-home path Use specified path instead of user account home dir
1291 or /home prefix.
1292 -U,--unix userlist Print UNIX users when using -l on a UNIX Samba
1293 server. Userlist is a comma-separated list of
1294 usernames or uid ranges (root,-25,50-100).
1295 Enumerating large ranges can take a long time!
1296 -h,--help Displays this message.
1297 -V,--version Version information and exit.
1298
1299 Default is to print local accounts on stand-alone machines, domain accounts
1300 on domain controllers and domain member machines.
1301 </screen>
1302 </refsect1>
1303
1304 <refsect1 id="mkpasswd-desc">
1305 <title>Description</title>
1306 <para>Don't use this command to generate a local /etc/passwd file, unless you
1307 really need one. See the Cygwin User's Guide for more information.</para>
1308
1309 <para>The <command>mkpasswd</command> program can be used to create a
1310 <filename>/etc/passwd</filename> file. Cygwin doesn't need this file,
1311 because it reads user information from the Windows account databases,
1312 but you can add an <filename>/etc/passwd</filename> file, for instance
1313 if your machine is often disconnected from its domain controller.</para>
1314
1315 <para>Note that this information is static, in contrast to the information
1316 automatically gathered by Cygwin from the Windows account databases. If
1317 you change the user information on your system, you'll need to regenerate
1318 the passwd file for it to have the new information.</para>
1319
1320 <para>By default, the information generated by <command>mkpasswd</command>
1321 is equivalent to the information generated by Cygwin itself. The
1322 <literal>-d</literal> and <literal>-l/-L</literal> options allow you to
1323 specify where the information comes from, some domain, or the local SAM
1324 of a machine. Note that you can only enumerate accounts from trusted
1325 domains. Any non-trusted domain will be ignored. Access-restrictions
1326 of your current account apply. The <literal>-l/-L</literal> when used
1327 with a machine name, tries to contact that machine to enumerate local
1328 groups of other machines, typically outside of domains. This scenario
1329 cannot be covered by Cygwin's account automatism. If you want to use
1330 the <literal>-L</literal> option, but you don't like the default
1331 domain/group separator from <filename>/etc/nsswitch.conf</filename>,
1332 you can specify another separator using the <literal>-S</literal> option,
1333 analog to <command>mkgroup</command>.</para>
1334
1335 <para>For very simple needs, an entry for the current user can be created
1336 by using the option <literal>-c</literal>.</para>
1337
1338 <para>The <literal>-o</literal> option allows for special cases (such as
1339 multiple domains) where the UIDs might match otherwise. The
1340 <literal>-p</literal> option causes <command>mkpasswd</command> to use
1341 the specified prefix instead of the account home dir or <literal>/home/
1342 </literal>. For example, this command:
1343 </para>
1344
1345 <example id="utils-althome-ex"
1346 ><title>Using an alternate home root</title>
1347 <screen>
1348 <prompt>$</prompt> <userinput>mkpasswd -l -p "$(cygpath -H)" &gt; /etc/passwd</userinput>
1349 </screen>
1350 </example>
1351
1352 <para>
1353 would put local users' home directories in the Windows
1354 'Profiles' directory. The <literal>-u</literal> option creates just an
1355 entry for the specified user. The <literal>-U</literal> option allows you
1356 to enumerate the standard UNIX users on a Samba machine. It's used
1357 together with <literal>-l samba-server</literal> or <literal>-L
1358 samba-server</literal>. The normal UNIX users are usually not enumerated,
1359 but they can show up as file owners in <command>ls -l</command> output.
1360 </para>
1361 </refsect1>
1362 </refentry>
1363
1364 <refentry id="mount">
1365 <refmeta>
1366 <refentrytitle>mount</refentrytitle>
1367 <manvolnum>1</manvolnum>
1368 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
1369 </refmeta>
1370
1371 <refnamediv>
1372 <refname>mount</refname>
1373 <refpurpose>Display information about mounted filesystems, or mount a filesystem</refpurpose>
1374 </refnamediv>
1375
1376 <refsynopsisdiv>
1377 <screen>
1378 mount [OPTION] [&lt;win32path&gt; &lt;posixpath&gt;]
1379 mount -a
1380 mount &lt;posixpath&gt;
1381 </screen>
1382 </refsynopsisdiv>
1383
1384 <refsect1 id="mount-options">
1385 <title>Options</title>
1386 <screen>
1387 -a, --all mount all filesystems mentioned in fstab
1388 -c, --change-cygdrive-prefix change the cygdrive path prefix to &lt;posixpath&gt;
1389 -f, --force force mount, don't warn about missing mount
1390 point directories
1391 -h, --help output usage information and exit
1392 -m, --mount-entries write fstab entries to replicate mount points
1393 and cygdrive prefixes
1394 -o, --options X[,X...] specify mount options
1395 -p, --show-cygdrive-prefix show user and/or system cygdrive path prefix
1396 -V, --version output version information and exit
1397 </screen>
1398 </refsect1>
1399
1400 <refsect1 id="mount-desc">
1401 <title>Description</title>
1402 <para>The <command>mount</command> program is used to map your drives and
1403 shares onto Cygwin's simulated POSIX directory tree, much like as is done
1404 by mount commands on typical UNIX systems. However, in contrast to mount
1405 points given in <filename>/etc/fstab</filename>, mount points created or
1406 changed with <command>mount</command> are not persistent. They disappear
1407 immediately after the last process of the current user exited. Please see
1408 <xref linkend="mount-table"/> for more information on the concepts behind
1409 the Cygwin POSIX file system and strategies for using mounts. To remove
1410 mounts temporarily, use <command>umount</command></para>
1411
1412 <refsect2 id="utils-mount">
1413 <title>Using mount</title>
1414
1415 <para>If you just type <command>mount</command> with no parameters, it
1416 will display the current mount table for you.</para>
1417
1418 <example id="utils-mount-ex">
1419 <title>Displaying the current set of mount points</title>
1420 <screen>
1421 <prompt>$</prompt> <userinput>mount</userinput>
1422 C:/cygwin/bin on /usr/bin type ntfs (binary)
1423 C:/cygwin/lib on /usr/lib type ntfs (binary)
1424 C:/cygwin on / type ntfs (binary)
1425 C: on /mnt/c type ntfs (binary,user,noumount)
1426 D: on /mnt/d type fat (binary,user,noumount)
1427 </screen>
1428 </example>
1429
1430 <para>In this example, c:/cygwin is the POSIX root and the D drive is
1431 mapped to <filename>/mnt/d</filename>. Note that in this case, the root
1432 mount is a system-wide mount point that is visible to all users running
1433 Cygwin programs, whereas the <filename>/mnt/d</filename> mount is only
1434 visible to the current user.</para>
1435
1436 <para>The <command>mount</command> utility is also the mechanism for
1437 adding new mounts to the mount table in memory. The following example
1438 demonstrates how to mount the directory
1439 <filename>//pollux/home/joe/data</filename> to
1440 <filename>/data</filename> for the duration of the current session. </para>
1441
1442 <example id="utils-mount-add-ex">
1443 <title>Adding mount points</title>
1444 <screen>
1445 <prompt>$</prompt> <userinput>ls /data</userinput>
1446 ls: /data: No such file or directory
1447 <prompt>$</prompt> <userinput>mount //pollux/home/joe/data /data</userinput>
1448 mount: warning - /data does not exist!
1449 <prompt>$</prompt> <userinput>mount</userinput>
1450 //pollux/home/joe/data on /data type smbfs (binary)
1451 C:/cygwin/bin on /usr/bin type ntfs (binary)
1452 C:/cygwin/lib on /usr/lib type ntfs (binary)
1453 C:/cygwin on / type ntfs (binary)
1454 C: on /c type ntfs (binary,user,noumount)
1455 D: on /d type fat (binary,user,noumount)
1456 </screen>
1457 </example>
1458
1459 <para>A given POSIX path may only exist once in the mount table. Attempts
1460 to replace the mount will fail with a busy error. The
1461 <literal>-f</literal> (force) option causes the old mount to be
1462 silently replaced with the new one, provided the old mount point was a
1463 user mount point. It's not valid to replace system-wide mount points.
1464 Additionally, the <literal>-f</literal> option will silence warnings
1465 about the non-existence of directories at the Win32 path
1466 location.</para>
1467
1468 <para> The <literal>-o</literal> option is the method via which various
1469 options about the mount point may be recorded. The following options
1470 are available (note that most of the options are duplicates of other
1471 mount flags):</para>
1472
1473 <screen>
1474 acl - Use the filesystem's access control lists (ACLs) to
1475 implement real POSIX permissions (default).
1476 binary - Files default to binary mode (default).
1477 bind - Allows to remount part of the file hierarchy somewhere else.
1478 Different from other mount calls, the first argument
1479 specifies an absolute POSIX path, rather than a Win32 path.
1480 This POSIX path is remounted to the POSIX path specified as
1481 the second parameter. The conversion to a Win32 path is done
1482 within Cygwin immediately at the time of the call. Note that
1483 symlinks are ignored while performing this path conversion.
1484 cygexec - Treat all files below mount point as cygwin executables.
1485 dos - Always convert leading spaces and trailing dots and spaces to
1486 characters in the UNICODE private use area. This allows to use
1487 broken filesystems which only allow DOS filenames, even if they
1488 are not recognized as such by Cygwin.
1489 exec - Treat all files below mount point as executable.
1490 ihash - Always fake inode numbers rather than using the ones returned
1491 by the filesystem. This allows to use broken filesystems which
1492 don't return unambiguous inode numbers, even if they are not
1493 recognized as such by Cygwin.
1494 noacl - Ignore ACLs and fake POSIX permissions.
1495 nosuid - No suid files are allowed (currently unimplemented)
1496 notexec - Treat all files below mount point as not executable.
1497 override - Override immutable mount points.
1498 posix=0 - Switch off case sensitivity for paths under this mount point.
1499 posix=1 - Switch on case sensitivity for paths under this mount point
1500 (default).
1501 sparse - Switch on support for sparse files. This option only makes
1502 sense on NTFS and then only if you really need sparse files.
1503 text - Files default to CRLF text mode line endings.
1504 </screen>
1505
1506 <para>For a more complete description of the mount options and the
1507 <filename>/etc/fstab</filename> file, see <xref linkend="mount-table"
1508 />.</para>
1509
1510 <para>Note that all mount points added with <command>mount</command> are
1511 user mount points. System mount points can only be specified in the
1512 <filename>/etc/fstab</filename> file.</para>
1513
1514 <para>If you added mount points to <filename>/etc/fstab</filename> or
1515 your <filename>/etc/fstab.d/&lt;username&gt;</filename> file, you can
1516 add these mount points to your current user session using the
1517 <literal>-a/--all</literal> option, or by specifing the posix path
1518 alone on the command line. As an example, consider you added a mount
1519 point with the POSIX path <filename>/my/mount</filename>. You can add
1520 this mount point with either one of the following two commands to your
1521 current user session.</para>
1522
1523 <screen>
1524 <prompt>$</prompt> <userinput>mount /my/mount</userinput>
1525 <prompt>$</prompt> <userinput>mount -a</userinput>
1526 </screen>
1527
1528 <para>The first command just adds the <filename>/my/mount</filename>
1529 mount point to your current session, the <command>mount -a</command>
1530 adds all new mount points to your user session.</para>
1531
1532 <para>If you change a mount point to point to another native path, or if
1533 you changed the flags of a mount point, you have to
1534 <command>umount</command> the mount point first, before you can add it
1535 again. Please note that all such added mount points are added as user
1536 mount points, and that the rule that system mount points can't be
1537 removed or replaced in a running session still applies.</para>
1538
1539 <para>To bind a POSIX path to another POSIX path, use the
1540 <literal>bind</literal> mount flag.</para>
1541
1542 <screen>
1543 <prompt>$</prompt> <userinput>mount -o bind /var /usr/var</userinput>
1544 </screen>
1545
1546 <para>This command makes the file hirarchy under
1547 <filename>/var</filename> additionally available under
1548 <filename>/usr/var</filename>.</para>
1549
1550 <para> The <literal>-m</literal> option causes the
1551 <command>mount</command> utility to output the current mount table in a
1552 series of fstab entries. You can save this output as a backup when
1553 experimenting with the mount table. Copy the output to
1554 <filename>/etc/fstab</filename> to restore the old state. It also makes
1555 moving your settings to a different machine much easier.</para>
1556
1557 </refsect2>
1558
1559 <refsect2 id="utils-cygdrive">
1560 <title>Cygdrive mount points</title>
1561
1562 <para>Whenever Cygwin cannot use any of the existing mounts to convert
1563 from a particular Win32 path to a POSIX one, Cygwin will, instead,
1564 convert to a POSIX path using a default mount point:
1565 <filename>/cygdrive</filename>. For example, if Cygwin accesses
1566 <filename>z:\foo</filename> and the z drive is not currently in the
1567 mount table, then <filename>z:\</filename> will be accessible as
1568 <filename>/cygdrive/z</filename>. The <command>mount</command> utility
1569 can be used to change this default automount prefix through the use of
1570 the "--change-cygdrive-prefix" option. In the following example, we
1571 will set the automount prefix to <filename>/mnt</filename>:</para>
1572
1573 <example id="utils-cygdrive-ex">
1574 <title>Changing the default prefix</title>
1575 <screen>
1576 <prompt>$</prompt> <userinput>mount --change-cygdrive-prefix /mnt</userinput>
1577 </screen>
1578 </example>
1579
1580 <para>Note that the cygdrive prefix can be set both per-user and
1581 system-wide, and that as with all mounts, a user-specific mount takes
1582 precedence over the system-wide setting. The <command>mount</command>
1583 utility creates system-wide mounts by default if you do not specify a
1584 type. You can always see the user and system cygdrive prefixes with the
1585 <literal>-p</literal> option. Using the <literal>--options</literal>
1586 flag with <literal>--change-cygdrive-prefix</literal> makes all new
1587 automounted filesystems default to this set of options. For instance
1588 (using the short form of the command line flags)</para>
1589
1590 <example id="utils-cygdrive-ex2">
1591 <title>Changing the default prefix with specific mount options</title>
1592 <screen>
1593 <prompt>$</prompt> <userinput>mount -c /mnt -o binary,noacl</userinput>
1594 </screen>
1595 </example>
1596
1597
1598 </refsect2>
1599
1600 <refsect2 id="utils-limitations">
1601 <title>Limitations</title>
1602
1603 <para>Limitations: there is a hard-coded limit of 64 mount points.
1604 Also, although you can mount to pathnames that do not start with "/",
1605 there is no way to make use of such mount points.</para>
1606
1607 <para>Normally the POSIX mount point in Cygwin is an existing empty
1608 directory, as in standard UNIX. If this is the case, or if there is a
1609 place-holder for the mount point (such as a file, a symbolic link
1610 pointing anywhere, or a non-empty directory), you will get the expected
1611 behavior. Files present in a mount point directory before the mount
1612 become invisible to Cygwin programs. </para>
1613
1614 <para>It is sometimes desirable to mount to a non-existent directory, for
1615 example to avoid cluttering the root directory with names such as
1616 <filename>a</filename>, <filename>b</filename>, <filename>c</filename>
1617 pointing to disks. Although <command>mount</command> will give you a
1618 warning, most everything will work properly when you refer to the mount
1619 point explicitly. Some strange effects can occur however. For example
1620 if your current working directory is <filename>/dir</filename>, say,
1621 and <filename>/dir/mtpt</filename> is a mount point, then
1622 <filename>mtpt</filename> will not show up in an <command>ls</command>
1623 or <command>echo *</command> command and <command>find .</command> will
1624 not find <filename>mtpt</filename>. </para>
1625
1626 </refsect2>
1627 </refsect1>
1628 </refentry>
1629
1630 <refentry id="passwd">
1631 <refmeta>
1632 <refentrytitle>passwd</refentrytitle>
1633 <manvolnum>1</manvolnum>
1634 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
1635 </refmeta>
1636
1637 <refnamediv>
1638 <refname>passwd</refname>
1639 <refpurpose>Change USER's password or password attributes.</refpurpose>
1640 </refnamediv>
1641
1642 <refsynopsisdiv>
1643 <screen>
1644 passwd [OPTION] [USER]
1645 </screen>
1646 </refsynopsisdiv>
1647
1648 <refsect1 id="passwd-options">
1649 <title>Options</title>
1650 <screen>
1651 User operations:
1652 -l, --lock lock USER's account.
1653 -u, --unlock unlock USER's account.
1654 -c, --cannot-change USER can't change password.
1655 -C, --can-change USER can change password.
1656 -e, --never-expires USER's password never expires.
1657 -E, --expires USER's password expires according to system's
1658 password aging rule.
1659 -p, --pwd-not-required no password required for USER.
1660 -P, --pwd-required password is required for USER.
1661 -R, --reg-store-pwd enter password to store it in the registry for
1662 later usage by services to be able to switch
1663 to this user context with network credentials.
1664
1665 System operations:
1666 -i, --inactive NUM set NUM of days before inactive accounts are disabled
1667 (inactive accounts are those with expired passwords).
1668 -n, --minage MINDAYS set system minimum password age to MINDAYS days.
1669 -x, --maxage MAXDAYS set system maximum password age to MAXDAYS days.
1670 -L, --length LEN set system minimum password length to LEN.
1671
1672 Other options:
1673 -d, --logonserver SERVER connect to SERVER (e.g. domain controller).
1674 Usually not required.
1675 -S, --status display password status for USER (locked, expired,
1676 etc.) plus global system password settings.
1677 -h, --help output usage information and exit.
1678 -V, --version output version information and exit.
1679
1680 If no option is given, change USER's password. If no user name is given,
1681 operate on current user. System operations must not be mixed with user
1682 operations. Don't specify a USER when triggering a system operation.
1683
1684 Don't specify a user or any other option together with the -R option.
1685 Non-Admin users can only store their password if cygserver is running.
1686 Note that storing even obfuscated passwords in the registry is not overly
1687 secure. Use this feature only if the machine is adequately locked down.
1688 Don't use this feature if you don't need network access within a remote
1689 session. You can delete your stored password by using `passwd -R' and
1690 specifying an empty password.
1691 </screen>
1692 </refsect1>
1693
1694 <refsect1 id="passwd-desc">
1695 <title>Description</title>
1696 <para> <command>passwd</command> changes passwords for user accounts. A
1697 normal user may only change the password for their own account, but
1698 administrators may change passwords on any account.
1699 <command>passwd</command> also changes account information, such as
1700 password expiry dates and intervals.</para>
1701
1702 <para>For password changes, the user is first prompted for their old
1703 password, if one is present. This password is then encrypted and compared
1704 against the stored password. The user has only one chance to enter the
1705 correct password. The administrators are permitted to bypass this step so
1706 that forgotten passwords may be changed.</para>
1707
1708 <para>The user is then prompted for a replacement password.
1709 <command>passwd</command> will prompt twice for this replacement and
1710 compare the second entry against the first. Both entries are required to
1711 match in order for the password to be changed.</para>
1712
1713 <para>After the password has been entered, password aging information is
1714 checked to see if the user is permitted to change their password at this
1715 time. If not, <command>passwd</command> refuses to change the password
1716 and exits.</para>
1717
1718 <para> To get current password status information, use the
1719 <literal>-S</literal> option. Administrators can use
1720 <command>passwd</command> to perform several account maintenance
1721 functions (users may perform some of these functions on their own
1722 accounts). Accounts may be locked with the <literal>-l</literal> flag and
1723 unlocked with the <literal>-u</literal> flag. Similarly,
1724 <literal>-c</literal> disables a user's ability to change passwords, and
1725 <literal>-C</literal> allows a user to change passwords. For password
1726 expiry, the <literal>-e</literal> option disables expiration, while the
1727 <literal>-E</literal> option causes the password to expire according to
1728 the system's normal aging rules. Use <literal>-p</literal> to disable the
1729 password requirement for a user, or <literal>-P</literal> to require a
1730 password. </para>
1731
1732 <para>Administrators can also use <command>passwd</command> to change
1733 system-wide password expiry and length requirements with the
1734 <literal>-i</literal>, <literal>-n</literal>, <literal>-x</literal>, and
1735 <literal>-L</literal> options. The <literal>-i</literal> option is used
1736 to disable an account after the password has been expired for a number of
1737 days. After a user account has had an expired password for
1738 <emphasis>NUM</emphasis> days, the user may no longer sign on to the
1739 account. The <literal>-n</literal> option is used to set the minimum
1740 number of days before a password may be changed. The user will not be
1741 permitted to change the password until <emphasis>MINDAYS</emphasis> days
1742 have elapsed. The <literal>-x</literal> option is used to set the maximum
1743 number of days a password remains valid. After
1744 <emphasis>MAXDAYS</emphasis> days, the password is required to be
1745 changed. Allowed values for the above options are 0 to 999. The
1746 <literal>-L</literal> option sets the minimum length of allowed passwords
1747 for users who don't belong to the administrators group to
1748 <emphasis>LEN</emphasis> characters. Allowed values for the minimum
1749 password length are 0 to 14. In any of the above cases, a value of 0
1750 means `no restrictions'.</para>
1751
1752 <para> All operations affecting the current user are by default run against
1753 the logon server of the current user (taken from the environment variable
1754 <envar>LOGONSERVER</envar>. When password or account information of other
1755 users should be changed, the logon server is evaluated automatically.
1756 In rare cases, it might be necessary to switch to another domain
1757 controller to perform the action. In this case, use the
1758 <literal>-d</literal> option to specify the machine to run the command
1759 against. Note that the current user must have account operator permissions
1760 to perform user account changes in a domain. </para>
1761
1762 <para>Users can use the <command>passwd -R</command> to enter a password
1763 which then gets stored in a special area of the registry on the local
1764 system, which is also used by Windows to store passwords of accounts
1765 running Windows services. When a privileged Cygwin application calls the
1766 <command>set{e}uid(user_id)</command> system call, Cygwin checks if a
1767 password for that user has been stored in this registry area. If so, it
1768 uses this password to switch to this user account using that password.
1769 This allows you to logon through, for instance, <command>ssh</command>
1770 with public key authentication and get a full qualified user token with
1771 all credentials for network access. However, the method has some
1772 drawbacks security-wise. This is explained in more detail in <xref
1773 linkend="ntsec"/>.</para>
1774
1775 <para>Please note that storing passwords in that registry area is a
1776 privileged operation which only administrative accounts are allowed to
1777 do. Administrators can enter the password for other user accounts into
1778 the registry by specifying the username on the commandline. If normal,
1779 non-admin users should be allowed to enter their passwords using
1780 <command>passwd -R</command>, it's required to run
1781 <command>cygserver</command> as a service under the LocalSystem account
1782 before running <command>passwd -R</command>. This only affects storing
1783 passwords. Using passwords in privileged processes does not require
1784 <command>cygserver</command> to run.</para>
1785
1786 <para>Limitations: Users may not be able to change their password on some
1787 systems.</para>
1788 </refsect1>
1789 </refentry>
1790
1791 <refentry id="pldd">
1792 <refmeta>
1793 <refentrytitle>pldd</refentrytitle>
1794 <manvolnum>1</manvolnum>
1795 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
1796 </refmeta>
1797
1798 <refnamediv>
1799 <refname>pldd</refname>
1800 <refpurpose>List dynamic shared objects loaded into a process</refpurpose>
1801 </refnamediv>
1802
1803 <refsynopsisdiv>
1804 <screen>
1805 pldd [OPTION...] PID
1806 </screen>
1807 </refsynopsisdiv>
1808
1809 <refsect1 id="pldd-options">
1810 <title>Options</title>
1811 <screen>
1812 -?, --help Give this help list
1813 --usage Give a short usage message
1814 -V, --version Print program version
1815 </screen>
1816 </refsect1>
1817
1818 <refsect1 id="pldd-desc">
1819 <title>Description</title>
1820 <para><command>pldd</command> prints the shared libraries (DLLs) loaded by
1821 the process with the given PID.</para>
1822 </refsect1>
1823 </refentry>
1824
1825 <refentry id="ps">
1826 <refmeta>
1827 <refentrytitle>ps</refentrytitle>
1828 <manvolnum>1</manvolnum>
1829 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
1830 </refmeta>
1831
1832 <refnamediv>
1833 <refname>ps</refname>
1834 <refpurpose>Report process status</refpurpose>
1835 </refnamediv>
1836
1837 <refsynopsisdiv>
1838 <screen>
1839 ps [-aefls] [-u UID]
1840 </screen>
1841 </refsynopsisdiv>
1842
1843 <refsect1 id="ps-options">
1844 <title>Options</title>
1845 <screen>
1846 -a, --all show processes of all users
1847 -e, --everyone show processes of all users
1848 -f, --full show process uids, ppids
1849 -h, --help output usage information and exit
1850 -l, --long show process uids, ppids, pgids, winpids
1851 -p, --process show information for specified PID
1852 -s, --summary show process summary
1853 -u, --user list processes owned by UID
1854 -V, --version output version information and exit
1855 -W, --windows show windows as well as cygwin processes
1856 With no options, ps outputs the long format by default
1857 </screen>
1858 </refsect1>
1859
1860 <refsect1 id="ps-desc">
1861 <title>Description</title>
1862 <para>The <command>ps</command> program gives the status of all the Cygwin
1863 processes running on the system (ps = "process status"). Due to the
1864 limitations of simulating a POSIX environment under Windows, there is
1865 little information to give. </para>
1866
1867 <para> The PID column is the process ID you need to give to the
1868 <command>kill</command> command. The PPID is the parent process ID, and
1869 PGID is the process group ID. The WINPID column is the process ID
1870 displayed by NT's Task Manager program. The TTY column gives which
1871 pseudo-terminal a process is running on, or a <literal>'?'</literal> for
1872 services. The UID column shows which user owns each process. STIME is the
1873 time the process was started, and COMMAND gives the name of the program
1874 running. Listings may also have a status flag in column zero;
1875 <literal>S</literal> means stopped or suspended (in other words, in the
1876 background), <literal>I</literal> means waiting for input or interactive
1877 (foreground), and <literal>O</literal> means waiting to output. </para>
1878
1879 <para> By default, <command>ps</command> will only show processes owned by
1880 the current user. With either the <literal>-a</literal> or
1881 <literal>-e</literal> option, all user's processes (and system processes)
1882 are listed. There are historical UNIX reasons for the synonomous options,
1883 which are functionally identical. The <literal>-f</literal> option
1884 outputs a "full" listing with usernames for UIDs. The
1885 <literal>-l</literal> option is the default display mode, showing a
1886 "long" listing with all the above columns. The other display option is
1887 <literal>-s</literal>, which outputs a shorter listing of just PID, TTY,
1888 STIME, and COMMAND. The <literal>-u</literal> option allows you to show
1889 only processes owned by a specific user. The <literal>-p</literal> option
1890 allows you to show information for only the process with the specified
1891 PID. The <literal>-W</literal> option causes <command>ps</command> show
1892 non-Cygwin Windows processes as well as Cygwin processes. The WINPID is
1893 also the PID, and they can be killed with the Cygwin
1894 <command>kill</command> command's <literal>-f</literal> option. </para>
1895 </refsect1>
1896 </refentry>
1897
1898 <refentry id="regtool">
1899 <refmeta>
1900 <refentrytitle>regtool</refentrytitle>
1901 <manvolnum>1</manvolnum>
1902 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
1903 </refmeta>
1904
1905 <refnamediv>
1906 <refname>regtool</refname>
1907 <refpurpose>View or edit the Windows registry</refpurpose>
1908 </refnamediv>
1909
1910 <refsynopsisdiv>
1911 <screen>
1912 regtool [OPTION] (add|check|get|list|remove|unset|load|unload|save) KEY
1913 </screen>
1914 </refsynopsisdiv>
1915
1916 <refsect1 id="regtool-options">
1917 <title>Options</title>
1918 <screen>
1919 Actions:
1920
1921 add KEY\SUBKEY add new SUBKEY
1922 check KEY exit 0 if KEY exists, 1 if not
1923 get KEY\VALUE prints VALUE to stdout
1924 list KEY list SUBKEYs and VALUEs
1925 remove KEY remove KEY
1926 set KEY\VALUE [data ...] set VALUE
1927 unset KEY\VALUE removes VALUE from KEY
1928 load KEY\SUBKEY PATH load hive from PATH into new SUBKEY
1929 unload KEY\SUBKEY unload hive and remove SUBKEY
1930 save KEY\SUBKEY PATH save SUBKEY into new file PATH
1931 restore KEY\SUBKEY PATH restore SUBKEY from file PATH
1932
1933 Options for 'list' Action:
1934
1935 -k, --keys print only KEYs
1936 -l, --list print only VALUEs
1937 -p, --postfix like ls -p, appends '\' postfix to KEY names
1938
1939 Options for 'get' Action:
1940
1941 -b, --binary print REG_BINARY data as hex bytes
1942 -n, --none print data as stream of bytes as stored in registry
1943 -x, --hex print numerical data as hex numbers
1944
1945 Options for 'set' Action:
1946
1947 -b, --binary set type to REG_BINARY (hex args or '-')
1948 -D, --dword-be set type to REG_DWORD_BIG_ENDIAN
1949 -e, --expand-string set type to REG_EXPAND_SZ
1950 -i, --integer set type to REG_DWORD
1951 -m, --multi-string set type to REG_MULTI_SZ
1952 -n, --none set type to REG_NONE
1953 -Q, --qword set type to REG_QWORD
1954 -s, --string set type to REG_SZ
1955
1956 Options for 'set' and 'unset' Actions:
1957
1958 -K&lt;c&gt;, --key-separator[=]&lt;c&gt; set key separator to &lt;c&gt; instead of '\'
1959
1960 Options for 'restore' action:
1961
1962 -f, --force restore even if open handles exist at or beneath the location
1963 in the registry hierarchy to which KEY\SUBKEY points
1964
1965 Other Options:
1966
1967 -h, --help output usage information and exit
1968 -q, --quiet no error output, just nonzero return if KEY/VALUE missing
1969 -v, --verbose verbose output, including VALUE contents when applicable
1970 -w, --wow64 access 64 bit registry view (ignored on 32 bit Windows)
1971 -W, --wow32 access 32 bit registry view (ignored on 32 bit Windows)
1972 -V, --version output version information and exit
1973
1974 KEY is in the format [host]\prefix\KEY\KEY\VALUE, where host is optional
1975 remote host in either \\hostname or hostname: format and prefix is any of:
1976 root HKCR HKEY_CLASSES_ROOT (local only)
1977 config HKCC HKEY_CURRENT_CONFIG (local only)
1978 user HKCU HKEY_CURRENT_USER (local only)
1979 machine HKLM HKEY_LOCAL_MACHINE
1980 users HKU HKEY_USERS
1981
1982 You can use forward slash ('/') as a separator instead of backslash, in
1983 that case backslash is treated as an escape character.
1984 You can also supply the registry path prefix /proc/registry{,32,64}/ to
1985 use path completion.
1986 Example:
1987 regtool list '/HKLM/SOFTWARE/Classes/MIME/Database/Content Type/audio\\/wav'
1988 </screen>
1989 </refsect1>
1990
1991 <refsect1 id="regtool-desc">
1992 <title>Description</title>
1993 <para>The <command>regtool</command> program allows shell scripts to access
1994 and modify the Windows registry. Note that modifying the Windows registry
1995 is dangerous, and carelessness here can result in an unusable system. Be
1996 careful.</para>
1997
1998 <para>The <literal>-v</literal> option means "verbose". For most commands,
1999 this causes additional or lengthier messages to be printed. Conversely,
2000 the <literal>-q</literal> option supresses error messages, so you can use
2001 the exit status of the program to detect if a key exists or not (for
2002 example).</para>
2003
2004 <para>The <literal>-w</literal> option allows you to access the 64 bit view
2005 of the registry. Several subkeys exist in a 32 bit and a 64 bit version
2006 when running on Windows 64. Since Cygwin is running in 32 bit mode, it
2007 only has access to the 32 bit view of these registry keys. When using the
2008 <literal>-w</literal> switch, the 64 bit view is used and
2009 <command>regtool</command> can access the entire registry. This option is
2010 simply ignored when running on 32 bit Windows versions. </para>
2011
2012 <para>The <literal>-W</literal> option allows you to access the 32 bit view
2013 on the registry. The purpose of this option is mainly for symmetry. It
2014 permits creation of OS agnostic scripts which would also work in a
2015 hypothetical 64 bit version of Cygwin.</para>
2016
2017 <para>You must provide <command>regtool</command> with an
2018 <emphasis>action</emphasis> following options (if any). Currently, the
2019 action must be <literal>add</literal>, <literal>set</literal>,
2020 <literal>check</literal>, <literal>get</literal>,
2021 <literal>list</literal>, <literal>remove</literal>,
2022 <literal>set</literal>, or <literal>unset</literal>. </para>
2023
2024 <para>The <literal>add</literal> action adds a new key. The
2025 <literal>check</literal> action checks to see if a key exists (the exit
2026 code of the program is zero if it does, nonzero if it does not). The
2027 <literal>get</literal> action gets the value of a key, and prints it (and
2028 nothing else) to stdout. Note: if the value doesn't exist, an error
2029 message is printed and the program returns a non-zero exit code. If you
2030 give <literal>-q</literal>, it doesn't print the message but does return
2031 the non-zero exit code.</para>
2032
2033 <para> The <literal>list</literal> action lists the subkeys and values
2034 belonging to the given key. With <literal>list</literal>, the
2035 <literal>-k</literal> option instructs <command>regtool</command> to
2036 print only KEYs, and the <literal>-l</literal> option to print only
2037 VALUEs. The <literal>-p</literal> option postfixes a
2038 <literal>'/'</literal> to each KEY, but leave VALUEs with no postfix. The
2039 <literal>remove</literal> action removes a key. Note that you may need to
2040 remove everything in the key before you may remove it, but don't rely on
2041 this stopping you from accidentally removing too much. </para>
2042
2043 <para>The <literal>get</literal> action prints a value within a key. With
2044 the <literal>-b</literal> option, data is printed as hex bytes.
2045 <literal>-n</literal> allows to print the data as a typeless stream of
2046 bytes. Integer values (REG_DWORD, REG_QWORD) are usually printed as
2047 decimal values. The <literal>-x</literal> option allows to print the
2048 numbers as hexadecimal values.</para>
2049
2050 <para>The <literal>set</literal> action sets a value within a key.
2051 <literal>-b</literal> means it's binary data (REG_BINARY). The binary
2052 values are specified as hex bytes in the argument list. If the argument
2053 is <literal>'-'</literal>, binary data is read from stdin instead.
2054 <literal>-d</literal> or <literal>-i</literal> means the value is a 32
2055 bit integer value (REG_DWORD). <literal>-D</literal> means the value is a
2056 32 bit integer value in Big Endian representation (REG_DWORD_BIG_ENDIAN).
2057 <literal>-Q</literal> means the value is a 64 bit integer value
2058 (REG_QWORD). <literal>-s</literal> means the value is a string (REG_SZ).
2059 <literal>-e</literal> means it's an expanding string (REG_EXPAND_SZ) that
2060 contains embedded environment variables. <literal>-m</literal> means it's
2061 a multi-string (REG_MULTI_SZ). If you don't specify one of these,
2062 <command>regtool</command> tries to guess the type based on the value you
2063 give. If it looks like a number, it's a DWORD, unless it's value doesn't
2064 fit into 32 bit, in which case it's a QWORD. If it starts with a percent,
2065 it's an expanding string. If you give multiple values, it's a
2066 multi-string. Else, it's a regular string.</para>
2067
2068 <para>The <literal>unset</literal> action removes a value from a
2069 key.</para>
2070
2071 <para>The <literal>load</literal> action adds a new subkey and loads the
2072 contents of a registry hive into it. The parent key must be
2073 HKEY_LOCAL_MACHINE or HKEY_USERS. The <literal>unload</literal> action
2074 unloads the file and removes the subkey. </para>
2075
2076 <para>The <literal>save</literal> action saves a subkey into a registry
2077 file. Ideally you append the suffix <filename>.reg</filename> to the file
2078 so it gets automatically recognized as registry file by
2079 <command>Windows Explorer</command>.</para>
2080
2081 <para>The <literal>restore</literal> action restores a registry subkey
2082 from a file saved via the aforementioned <literal>save</literal> action.
2083 </para>
2084
2085 <para> By default, the last "\" or "/" is assumed to be the separator
2086 between the key and the value. You can use the <literal>-K</literal>
2087 option to provide an alternate key/value separator character. </para>
2088 </refsect1>
2089 </refentry>
2090
2091 <refentry id="setfacl">
2092 <refmeta>
2093 <refentrytitle>setfacl</refentrytitle>
2094 <manvolnum>1</manvolnum>
2095 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
2096 </refmeta>
2097
2098 <refnamediv>
2099 <refname>setfacl</refname>
2100 <refpurpose>Modify file and directory access control lists (ACLs)</refpurpose>
2101 </refnamediv>
2102
2103 <refsynopsisdiv>
2104 <screen>
2105 setfacl [-n] {-f ACL_FILE | -s acl_entries} FILE...
2106 setfacl [-n] {[-bk]|[-x acl_entries] [-m acl_entries]} FILE...
2107 </screen>
2108 </refsynopsisdiv>
2109
2110 <refsect1 id="setfacl-options">
2111 <title>Options</title>
2112 <screen>
2113 -b, --remove-all remove all extended ACL entries\n"
2114 -x, --delete delete one or more specified ACL entries\n"
2115 -f, --set-file set ACL entries for FILE to ACL entries read\n"
2116 from ACL_FILE\n"
2117 -k, --remove-default remove all default ACL entries\n"
2118 -m, --modify modify one or more specified ACL entries\n"
2119 -n, --no-mask don't recalculate the effective rights mask\n"
2120 --mask do recalculate the effective rights mask\n"
2121 -s, --set set specified ACL entries on FILE\n"
2122 -V, --version print version and exit\n"
2123 -h, --help this help text\n"
2124
2125 At least one of (-b, -x, -f, -k, -m, -s) must be specified\n"
2126 </screen>
2127 </refsect1>
2128
2129 <refsect1 id="setfacl-desc">
2130 <title>Description</title>
2131 <para> For each file given as parameter, <command>setfacl</command> will
2132 either replace its complete ACL (<literal>-s</literal>,
2133 <literal>-f</literal>), or it will add, modify, or delete ACL entries.
2134 For more information on Cygwin and Windows ACLs, see
2135 <xref linkend="ntsec"/> in the Cygwin User's Guide. </para>
2136
2137 <para> Acl_entries are one or more comma-separated ACL entries from the
2138 following list:
2139 <screen>
2140 u[ser]::perm
2141 u[ser]:uid:perm
2142 g[roup]::perm
2143 g[roup]:gid:perm
2144 m[ask]::perm
2145 o[ther]::perm
2146 </screen>
2147 Default entries are like the above with the additional default
2148 identifier. For example:
2149 <screen>
2150 d[efault]:u[ser]:uid:perm
2151 </screen> </para>
2152
2153 <para> <emphasis>perm</emphasis> is either a 3-char permissions string in
2154 the form "rwx" with the character <literal>'-'</literal> for no
2155 permission or it is the octal representation of the permissions, a value
2156 from 0 (equivalent to "---") to 7 ("rwx"). <emphasis>uid</emphasis> is a
2157 user name or a numerical uid. <emphasis>gid</emphasis> is a group name or
2158 a numerical gid. </para>
2159
2160 <para> The following options are supported: </para>
2161
2162 <para> <literal>-b</literal>,<literal>--remove-all</literal> Remove all
2163 extended ACL entries. The base ACL entries of the owner, group and
2164 others are retained. This option can be combined with the
2165 <literal>-k</literal>,<literal>--remove-default</literal> option
2166 to delete all non-standard POSIX permissions.</para>
2167
2168 <para> <literal>-x</literal>,<literal>--delete</literal> Delete one or
2169 more specified entries from the file's ACL. The owner, group and others
2170 entries must not be deleted. Acl_entries to be deleted should be
2171 specified without permissions, as in the following list:
2172 <screen>
2173 u[ser]:uid[:]
2174 g[roup]:gid[:]
2175 m[ask][:]
2176 d[efault]:u[ser][:uid]
2177 d[efault]:g[roup][:gid]
2178 d[efault]:m[ask][:]
2179 d[efault]:o[ther][:]
2180 </screen> </para>
2181
2182 <para> <literal>-f</literal>,<literal>--set-file</literal> Take the Acl_entries
2183 from ACL_FILE one per line. Whitespace characters are ignored, and the
2184 character "#" may be used to start a comment. The special filename "-"
2185 indicates reading from stdin. Note that you can use this with
2186 <command>getfacl</command> and <command>setfacl</command> to copy ACLs
2187 from one file to another:
2188 <screen>
2189 $ getfacl source_file | setfacl -f - target_file
2190 </screen> </para>
2191
2192 <para> Required entries are: one user entry for the owner of the file, one
2193 group entry for the group of the file, and one other entry. </para>
2194
2195 <para> If additional user and group entries are given: a mask entry for the
2196 file group class of the file, and no duplicate user or group entries with
2197 the same uid/gid. </para>
2198
2199 <para> If it is a directory: one default user entry for the owner of the
2200 file, one default group entry for the group of the file, one default mask
2201 entry for the file group class, and one default other entry. </para>
2202
2203 <para> <literal>-k</literal>,<literal>--remove-default</literal> Remove all
2204 default ACL entries. If no default ACL entries exist, no warnings are
2205 issued. This option can be combined with the
2206 <literal>-b</literal>,<literal>--remove-all</literal> option
2207 to delete all non-standard POSIX permissions.</para>
2208
2209 <para> <literal>-m</literal>,<literal>--modify</literal> Add or modify one
2210 or more specified ACL entries. Acl_entries is a comma-separated list of
2211 entries from the same list as above. </para>
2212
2213 <para> <literal>-n</literal>,<literal>--no-mask</literal> Valid in
2214 conjunction with -m. Do not recalculate the effective rights mask.
2215 The default behavior of setfacl is to recalculate the ACL mask entry,
2216 unless a mask entry was explicitly given. The mask entry is set to
2217 the union of all permissions of the owning group, and all named user
2218 and group entries. (These are exactly the entries affected by the
2219 mask entry). </para>
2220
2221 <para> <literal>--mask</literal> Valid in conjunction with -m. Do
2222 recalculate the effective rights mask, even if an ACL mask entry was
2223 explicitly given. (See the -n option.) </para>
2224
2225 <para> <literal>-s</literal>,<literal>--set</literal> Like
2226 <literal>-f</literal>, but set the file's ACL with Acl_entries
2227 specified in a comma-separated list on the command line. </para>
2228
2229 <para> While the <literal>-x</literal> and <literal>-m</literal> options
2230 may be used in the same command, the <literal>-f</literal> and
2231 <literal>-s</literal> options may be used only exclusively. </para>
2232
2233 <para> Directories may contain default ACL entries. Files created in a
2234 directory that contains default ACL entries will have permissions
2235 according to the combination of the current umask, the explicit
2236 permissions requested and the default ACL entries.</para>
2237 </refsect1>
2238 </refentry>
2239
2240 <refentry id="setmetamode">
2241 <refmeta>
2242 <refentrytitle>setmetamode</refentrytitle>
2243 <manvolnum>1</manvolnum>
2244 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
2245 </refmeta>
2246
2247 <refnamediv>
2248 <refname>setmetamode</refname>
2249 <refpurpose>Get or set keyboard meta mode</refpurpose>
2250 </refnamediv>
2251
2252 <refsynopsisdiv>
2253 <screen>
2254 setmetamode [metabit|escprefix]
2255 </screen>
2256 </refsynopsisdiv>
2257
2258 <refsect1 id="setmetamode-options">
2259 <title>Options</title>
2260 <screen>
2261 Without argument, it shows the current meta key mode.
2262
2263 metabit|meta|bit The meta key sets the top bit of the character.
2264 escprefix|esc|prefix The meta key sends an escape prefix.
2265
2266 Other options:
2267
2268 -h, --help This text
2269 -V, --version Print program version and exit
2270 </screen>
2271 </refsect1>
2272
2273 <refsect1 id="setmetamode-desc">
2274 <title>Description</title>
2275 <para><command>setmetamode</command> can be used to determine and set the
2276 key code sent by the meta (aka <literal>Alt</literal>) key.</para>
2277 </refsect1>
2278 </refentry>
2279
2280 <refentry id="ssp">
2281 <refmeta>
2282 <refentrytitle>ssp</refentrytitle>
2283 <manvolnum>1</manvolnum>
2284 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
2285 </refmeta>
2286
2287 <refnamediv>
2288 <refname>ssp</refname>
2289 <refpurpose>Single-step profile COMMAND</refpurpose>
2290 </refnamediv>
2291
2292 <refsynopsisdiv>
2293 <screen>
2294 ssp [options] low_pc high_pc command...
2295 </screen>
2296 </refsynopsisdiv>
2297
2298 <refsect1 id="ssp-options">
2299 <title>Options</title>
2300 <screen>
2301 -c, --console-trace trace every EIP value to the console. *Lots* slower.
2302 -d, --disable disable single-stepping by default; use
2303 OutputDebugString ("ssp on") to enable stepping
2304 -e, --enable enable single-stepping by default; use
2305 OutputDebugString ("ssp off") to disable stepping
2306 -h, --help output usage information and exit
2307 -l, --dll enable dll profiling. A chart of relative DLL usage
2308 is produced after the run.
2309 -s, --sub-threads trace sub-threads too. Dangerous if you have
2310 race conditions.
2311 -t, --trace-eip trace every EIP value to a file TRACE.SSP. This
2312 gets big *fast*.
2313 -v, --verbose output verbose messages about debug events.
2314 -V, --version output version information and exit
2315
2316 Example: ssp 0x401000 0x403000 hello.exe
2317 </screen>
2318 </refsect1>
2319
2320 <refsect1 id="ssp-desc">
2321 <title>Description</title>
2322 <para> SSP - The Single Step Profiler </para>
2323
2324 <para> Original Author: DJ Delorie </para>
2325
2326 <para> The SSP is a program that uses the Win32 debug API to run a program
2327 one ASM instruction at a time. It records the location of each
2328 instruction used, how many times that instruction is used, and all
2329 function calls. The results are saved in a format that is usable by the
2330 profiling program <command>gprof</command>, although
2331 <command>gprof</command> will claim the values are seconds, they really
2332 are instruction counts. More on that later. </para>
2333
2334 <para> Because the SSP was originally designed to profile the Cygwin DLL,
2335 it does not automatically select a block of code to report statistics on.
2336 You must specify the range of memory addresses to keep track of manually,
2337 but it's not hard to figure out what to specify. Use the "objdump"
2338 program to determine the bounds of the target's ".text" section. Let's
2339 say we're profiling cygwin1.dll. Make sure you've built it with debug
2340 symbols (else <command>gprof</command> won't run) and run objdump like
2341 this: <screen>
2342 $ objdump -h cygwin1.dll
2343 </screen> It will print a report
2344 like this:
2345 <screen>
2346 cygwin1.dll: file format pei-i386
2347
2348 Sections:
2349 Idx Name Size VMA LMA File off Algn
2350 0 .text 0007ea00 61001000 61001000 00000400 2**2
2351 CONTENTS, ALLOC, LOAD, READONLY, CODE, DATA
2352 1 .data 00008000 61080000 61080000 0007ee00 2**2
2353 CONTENTS, ALLOC, LOAD, DATA
2354 . . .
2355 </screen> </para>
2356
2357 <para> The only information we're concerned with are the VMA of the .text
2358 section and the VMA of the section after it (sections are usually
2359 contiguous; you can also add the Size to the VMA to get the end address).
2360 In this case, the VMA is 0x61001000 and the ending address is either
2361 0x61080000 (start of .data method) or 0x0x6107fa00 (VMA+Size method). </para>
2362
2363 <para> There are two basic ways to use SSP - either profiling a whole
2364 program, or selectively profiling parts of the program. </para>
2365
2366 <para> To profile a whole program, just run <command>ssp</command> without
2367 options. By default, it will step the whole program. Here's a simple
2368 example, using the numbers above:
2369 <screen>
2370 $ ssp 0x61001000 0x61080000 hello.exe
2371 </screen> This will step
2372 the whole program. It will take at least 8 minutes on a PII/300 (yes,
2373 really). When it's done, it will create a file called "gmon.out". You can
2374 turn this data file into a readable report with <command>gprof</command>:
2375 <screen>
2376 $ gprof -b cygwin1.dll
2377 </screen> The "-b" means 'skip the help
2378 pages'. You can omit this until you're familiar with the report layout.
2379 The <command>gprof</command> documentation explains a lot about this
2380 report, but <command>ssp</command> changes a few things. For example, the
2381 first part of the report reports the amount of time spent in each
2382 function, like this:
2383 <screen>
2384 Each sample counts as 0.01 seconds.
2385 % cumulative self self total
2386 time seconds seconds calls ms/call ms/call name
2387 10.02 231.22 72.43 46 1574.57 1574.57 strcspn
2388 7.95 288.70 57.48 130 442.15 442.15 strncasematch
2389 </screen>
2390 The "seconds" columns are really CPU opcodes, 1/100 second per opcode.
2391 So, "231.22" above means 23,122 opcodes. The ms/call values are 10x too
2392 big; 1574.57 means 157.457 opcodes per call. Similar adjustments need to
2393 be made for the "self" and "children" columns in the second part of the
2394 report. </para>
2395
2396 <para> OK, so now we've got a huge report that took a long time to
2397 generate, and we've identified a spot we want to work on optimizing.
2398 Let's say it's the time() function. We can use SSP to selectively profile
2399 this function by using OutputDebugString() to control SSP from within the
2400 program. Here's a sample program:
2401 <screen>
2402 #include &lt;windows.h&gt;
2403 main()
2404 {
2405 time_t t;
2406 OutputDebugString("ssp on");
2407 time(&amp;t);
2408 OutputDebugString("ssp off");
2409 }
2410 </screen> </para>
2411
2412 <para> Then, add the <literal>-d</literal> option to ssp to default to
2413 *disabling* profiling. The program will run at full speed until the first
2414 OutputDebugString, then step until the second. You can then use
2415 <command>gprof</command> (as usual) to see the performance profile for
2416 just that portion of the program's execution. </para>
2417
2418 <para> There are many options to ssp. Since step-profiling makes your
2419 program run about 1,000 times slower than normal, it's best to understand
2420 all the options so that you can narrow down the parts of your program you
2421 need to single-step. </para>
2422
2423 <para> <literal>-v</literal> - verbose. This prints messages about threads
2424 starting and stopping, OutputDebugString calls, DLLs loading, etc. </para>
2425
2426 <para> <literal>-t</literal> and <literal>-c</literal> - tracing. With
2427 <literal>-t</literal>, *every* step's address is written to the file
2428 "trace.ssp". This can be used to help debug functions, since it can trace
2429 multiple threads. Clever use of scripts can match addresses with
2430 disassembled opcodes if needed. Warning: creates *huge* files, very
2431 quickly. <literal>-c</literal> prints each address to the console, useful
2432 for debugging key chunks of assembler. Use <literal>addr2line -C -f -s -e
2433 foo.exe &lt; trace.ssp &gt; lines.ssp</literal> and then <literal>perl
2434 cvttrace</literal> to convert to symbolic traces. </para>
2435
2436 <para> <literal>-s</literal> - subthreads. Usually, you only need to trace
2437 the main thread, but sometimes you need to trace all threads, so this
2438 enables that. It's also needed when you want to profile a function that
2439 only a subthread calls. However, using OutputDebugString automatically
2440 enables profiling on the thread that called it, not the main thread. </para>
2441
2442 <para> <literal>-l</literal> - dll profiling. Generates a pretty table of
2443 how much time was spent in each dll the program used. No sense optimizing
2444 a function in your program if most of the time is spent in the DLL. I
2445 usually use the <literal>-v</literal>, <literal>-s</literal>, and
2446 <literal>-l</literal> options:
2447 <screen>
2448 $ ssp <literal>-v</literal> <literal>-s</literal> <literal>-l</literal> <literal>-d</literal> 0x61001000 0x61080000 hello.exe
2449 </screen>
2450 </para>
2451 </refsect1>
2452 </refentry>
2453
2454 <refentry id="strace">
2455 <refmeta>
2456 <refentrytitle>strace</refentrytitle>
2457 <manvolnum>1</manvolnum>
2458 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
2459 </refmeta>
2460
2461 <refnamediv>
2462 <refname>strace</refname>
2463 <refpurpose>Trace system calls and signals</refpurpose>
2464 </refnamediv>
2465
2466 <refsynopsisdiv>
2467 <screen>
2468 strace [OPTIONS] &lt;command-line&gt;
2469 strace [OPTIONS] -p &lt;pid&gt;
2470 </screen>
2471 </refsynopsisdiv>
2472
2473 <refsect1 id="strace-options">
2474 <title>Options</title>
2475 <screen>
2476 -b, --buffer-size=SIZE set size of output file buffer
2477 -d, --no-delta don't display the delta-t microsecond timestamp
2478 -e, --events log all Windows DEBUG_EVENTS (toggle - default true)
2479 -f, --trace-children trace child processes (toggle - default true)
2480 -h, --help output usage information and exit
2481 -m, --mask=MASK set message filter mask
2482 -n, --crack-error-numbers output descriptive text instead of error
2483 numbers for Windows errors
2484 -o, --output=FILENAME set output file to FILENAME
2485 -p, --pid=n attach to executing program with cygwin pid n
2486 -q, --quiet toggle "quiet" flag. Defaults to on if "-p",
2487 off otherwise.
2488 -S, --flush-period=PERIOD flush buffered strace output every PERIOD secs
2489 -t, --timestamp use an absolute hh:mm:ss timestamp insted of
2490 the default microsecond timestamp. Implies -d
2491 -T, --toggle toggle tracing in a process already being
2492 traced. Requires -p &lt;pid&gt;
2493 -u, --usecs toggle printing of microseconds timestamp
2494 -V, --version output version information and exit
2495 -w, --new-window spawn program under test in a new window
2496
2497 MASK can be any combination of the following mnemonics and/or hex values
2498 (0x is optional). Combine masks with '+' or ',' like so:
2499
2500 --mask=wm+system,malloc+0x00800
2501
2502 Mnemonic Hex Corresponding Def Description
2503 =========================================================================
2504 all 0x000001 (_STRACE_ALL) All strace messages.
2505 flush 0x000002 (_STRACE_FLUSH) Flush output buffer after each message.
2506 inherit 0x000004 (_STRACE_INHERIT) Children inherit mask from parent.
2507 uhoh 0x000008 (_STRACE_UHOH) Unusual or weird phenomenon.
2508 syscall 0x000010 (_STRACE_SYSCALL) System calls.
2509 startup 0x000020 (_STRACE_STARTUP) argc/envp printout at startup.
2510 debug 0x000040 (_STRACE_DEBUG) Info to help debugging.
2511 paranoid 0x000080 (_STRACE_PARANOID) Paranoid info.
2512 termios 0x000100 (_STRACE_TERMIOS) Info for debugging termios stuff.
2513 select 0x000200 (_STRACE_SELECT) Info on ugly select internals.
2514 wm 0x000400 (_STRACE_WM) Trace Windows msgs (enable _strace_wm).
2515 sigp 0x000800 (_STRACE_SIGP) Trace signal and process handling.
2516 minimal 0x001000 (_STRACE_MINIMAL) Very minimal strace output.
2517 pthread 0x002000 (_STRACE_PTHREAD) Pthread calls.
2518 exitdump 0x004000 (_STRACE_EXITDUMP) Dump strace cache on exit.
2519 system 0x008000 (_STRACE_SYSTEM) Serious error; goes to console and log.
2520 nomutex 0x010000 (_STRACE_NOMUTEX) Don't use mutex for synchronization.
2521 malloc 0x020000 (_STRACE_MALLOC) Trace malloc calls.
2522 thread 0x040000 (_STRACE_THREAD) Thread-locking calls.
2523 special 0x100000 (_STRACE_SPECIAL) Special debugging printfs for
2524 non-checked-in code
2525 </screen>
2526 </refsect1>
2527
2528 <refsect1 id="strace-desc">
2529 <title>Description</title>
2530 <para>The <command>strace</command> program executes a program, and
2531 optionally the children of the program, reporting any Cygwin DLL output
2532 from the program(s) to stdout, or to a file with the
2533 <literal>-o</literal> option. With the <literal>-w</literal> option, you
2534 can start an strace session in a new window, for example:
2535 <screen>
2536 $ strace -o tracing_output -w sh -c 'while true; do echo "tracing..."; done' &amp;
2537 </screen>
2538 This is particularly useful for <command>strace</command> sessions that
2539 take a long time to complete. </para>
2540
2541 <para> Note that <command>strace</command> is a standalone Windows program
2542 and so does not rely on the Cygwin DLL itself (you can verify this with
2543 <command>cygcheck</command>). As a result it does not understand
2544 symlinks. This program is mainly useful for debugging the Cygwin DLL
2545 itself.</para>
2546 </refsect1>
2547 </refentry>
2548
2549 <refentry id="tzset">
2550 <refmeta>
2551 <refentrytitle>tzset</refentrytitle>
2552 <manvolnum>1</manvolnum>
2553 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
2554 </refmeta>
2555
2556 <refnamediv>
2557 <refname>tzset</refname>
2558 <refpurpose>Print POSIX-compatible timezone ID from current Windows timezone setting</refpurpose>
2559 </refnamediv>
2560
2561 <refsynopsisdiv>
2562 <screen>
2563 tzset [OPTION]
2564 </screen>
2565 </refsynopsisdiv>
2566
2567 <refsect1 id="tzset-options">
2568 <title>Options</title>
2569 <screen>
2570 Options:
2571 -h, --help output usage information and exit.
2572 -V, --version output version information and exit.
2573 </screen>
2574 </refsect1>
2575
2576 <refsect1 id="tzset-desc">
2577 <title>Description</title>
2578 Use tzset to set your TZ variable. In POSIX-compatible shells like bash,
2579 dash, mksh, or zsh:
2580 <screen>
2581 export TZ=$(tzset)
2582 </screen>
2583 In csh-compatible shells like tcsh:
2584 <screen>
2585 setenv TZ `tzset`
2586 </screen>
2587
2588 <para>The <command>tzset</command> tool reads the current timezone from
2589 Windows and generates a POSIX-compatible timezone information for the TZ
2590 environment variable from that information. That's all there is to it.
2591 For the way how to use it, see the above usage information.</para>
2592 </refsect1>
2593 </refentry>
2594
2595 <refentry id="umount">
2596 <refmeta>
2597 <refentrytitle>umount</refentrytitle>
2598 <manvolnum>1</manvolnum>
2599 <refmiscinfo class="manual">Cygwin Utilities</refmiscinfo>
2600 </refmeta>
2601
2602 <refnamediv>
2603 <refname>umount</refname>
2604 <refpurpose>Unmount filesystems</refpurpose>
2605 </refnamediv>
2606
2607 <refsynopsisdiv>
2608 <screen>
2609 umount [OPTION] [&lt;posixpath&gt;]
2610 </screen>
2611 </refsynopsisdiv>
2612
2613 <refsect1 id="umount-options">
2614 <title>Options</title>
2615 <screen>
2616 -h, --help output usage information and exit
2617 -U, --remove-user-mounts remove all user mounts
2618 -V, --version output version information and exit
2619 </screen>
2620 </refsect1>
2621
2622 <refsect1 id="umount-desc">
2623 <title>Description</title>
2624 <para>The <command>umount</command> program removes mounts from the mount
2625 table in the current session. If you specify a POSIX path that
2626 corresponds to a current mount point, <command>umount</command> will
2627 remove it from the current mount table. Note that you can only remove
2628 user mount points. The <literal>-U</literal> flag may be used to specify
2629 removing all user mount points from the current user session.</para>
2630
2631 <para>See <xref linkend="mount-table"/> for more information on the mount
2632 table.</para>
2633 </refsect1>
2634 </refentry>
2635
2636 </sect1>
This page took 0.150839 seconds and 5 git commands to generate.