<s>
The	O
tsort	B-Device
program	O
is	O
a	O
command	B-Application
line	I-Application
utility	O
on	O
Unix	B-Application
and	O
Unix-like	B-Operating_System
platforms	O
,	O
that	O
performs	O
a	O
topological	B-Algorithm
sort	I-Algorithm
on	O
its	O
input	O
.	O
</s>
<s>
According	O
to	O
its	O
info	B-Protocol
page	O
,	O
this	O
command	B-Application
was	O
initially	O
written	O
for	O
providing	O
an	O
ordering	O
of	O
object	O
files	O
that	O
allowed	O
the	O
linker	B-Application
to	O
process	O
them	O
sequentially	O
(	O
each	O
one	O
exactly	O
once	O
,	O
and	O
in	O
order	O
)	O
.	O
</s>
<s>
The	O
FreeBSD	B-Operating_System
manual	O
page	O
dates	O
its	O
appearance	O
to	O
Version	B-Operating_System
7	I-Operating_System
Unix	I-Operating_System
.	O
</s>
<s>
Note	O
that	O
the	O
following	O
description	O
is	O
describing	O
the	O
behaviour	O
of	O
the	O
FreeBSD	B-Operating_System
implementation	O
of	O
tsort	B-Device
and	O
mentions	O
GNU	O
features	O
where	O
they	O
may	O
exist	O
.	O
</s>
<s>
FreeBSD	B-Operating_System
options	O
can	O
be	O
:	O
</s>
<s>
tsort	B-Device
reads	O
its	O
input	O
(	O
from	O
the	O
given	O
FILE	O
,	O
or	O
standard	B-Operating_System
input	I-Operating_System
if	O
no	O
input	O
file	O
is	O
given	O
or	O
for	O
a	O
FILE	O
of	O
'	O
-	O
'	O
)	O
as	O
pairs	O
of	O
strings	O
,	O
separated	O
by	O
blanks	O
,	O
indicating	O
a	O
partial	O
ordering	O
.	O
</s>
<s>
tsort	B-Device
lists	O
the	O
vertices	O
of	O
a	O
directed	O
acyclic	O
graph	O
in	O
such	O
an	O
order	O
that	O
all	O
ordering/direction	O
relations	O
are	O
respected	O
:	O
</s>
<s>
tsort	B-Device
can	O
help	O
rearranging	O
functions	O
in	O
a	O
source	O
file	O
so	O
that	O
as	O
many	O
as	O
possible	O
are	O
defined	O
before	O
they	O
are	O
used	O
(	O
Interpret	O
the	O
following	O
as	O
:	O
calls	O
,	O
and	O
;	O
calls	O
,	O
and	O
so	O
on	O
.	O
</s>
<s>
The	O
traditional	O
ld	B-Device
(	O
Unix	B-Application
linker	B-Application
)	O
requires	O
that	O
its	O
library	O
inputs	O
be	O
sorted	O
in	O
topological	O
order	O
,	O
since	O
it	O
processes	O
files	O
in	O
a	O
single	O
pass	O
.	O
</s>
<s>
BSD	O
UNIX	B-Application
uses	O
tsort	B-Device
as	O
a	O
common	O
part	O
of	O
the	O
typical	O
ar	B-Application
&	O
ranlib	O
command	B-Application
invocations	O
(	O
from	O
/usr/share/mk/bsd.lib.mk	O
)	O
:	O
</s>
<s>
Strictly	O
speaking	O
there	O
is	O
no	O
topological	B-Algorithm
ordering	I-Algorithm
of	O
a	O
graph	O
that	O
contains	O
one	O
or	O
more	O
cycles	O
.	O
</s>
<s>
However	O
tsort	B-Device
prints	O
a	O
warning	O
and	O
GNU	O
tsort	B-Device
prints	O
the	O
detected	O
cycles	O
to	O
standard	O
error	O
(	O
lines	O
beginning	O
with	O
'	O
tsort	B-Device
:	O
'	O
)	O
:	O
</s>
