Журнал лабораторных работ

Содержание

Журнал

Среда (08/01/12)

/dev/pts/2
07:23:58
$ping 192.168.0.31
PING 192.168.0.31 (192.168.0.31) 56(84) bytes of data.
From 192.168.0.127 icmp_seq=1 Destination Host Unreachable
From 192.168.0.127 icmp_seq=2 Destination Host Unreachable
From 192.168.0.127 icmp_seq=3 Destination Host Unreachable
From 192.168.0.127 icmp_seq=4 Destination Host Unreachable
From 192.168.0.127 icmp_seq=5 Destination Host Unreachable
From 192.168.0.127 icmp_seq=6 Destination Host Unreachable
From 192.168.0.127 icmp_seq=7 Destination Host Unreachable
From 192.168.0.127 icmp_seq=8 Destination Host Unreachable
From 192.168.0.127 icmp_seq=9 Destination Host Unreachable
From 192.168.0.127 icmp_seq=10 Destination Host Unreachable
From 192.168.0.127 icmp_seq=11 Destination Host Unreachable
From 192.168.0.127 icmp_seq=12 Destination Host Unreachable
From 192.168.0.127 icmp_seq=13 Destination Host Unreachable
From 192.168.0.127 icmp_seq=14 Destination Host Unreachable
From 192.168.0.127 icmp_seq=15 Destination Host Unreachable
^Z
[1]+  Stopped                 ping 192.168.0.31

Понедельник (08/06/12)

/dev/pts/5
06:26:50
$ping 192.168.0.240

06:26:50
$ping 192.168.0.240
200           rdesktop -uol14 -p13r@7t -g1024x768 -a16 -k en-us.fixed 192.168.0.2
WARNING: No translation for (keysym 0xfe0a, ISO_Prev_Group)
WARNING: No translation for (keysym 0x6fc, Cyrillic_E)
WARNING: No translation for (keysym 0x6dc, Cyrillic_e)
WARNING: No translation for (keysym 0x6cb, Cyrillic_ka)
WARNING: No translation for (keysym 0x6cb, Cyrillic_ka)
WARNING: No translation for (keysym 0x6cf, Cyrillic_o)
WARNING: No translation for (keysym 0x6cf, Cyrillic_o)
WARNING: No translation for (keysym 0x6c8, Cyrillic_ha)
WARNING: No translation for (keysym 0x6c8, Cyrillic_ha)
...
WARNING: No translation for (keysym 0x6cf, Cyrillic_o)
WARNING: No translation for (keysym 0x6cf, Cyrillic_o)
WARNING: No translation for (keysym 0x6cd, Cyrillic_em)
WARNING: No translation for (keysym 0x6cd, Cyrillic_em)
WARNING: No translation for (keysym 0x6fc, Cyrillic_E)
WARNING: No translation for (keysym 0x6dc, Cyrillic_e)
WARNING: No translation for (keysym 0x6f0, Cyrillic_PE)
WARNING: No translation for (keysym 0x6f0, Cyrillic_PE)
WARNING: No translation for (keysym 0x6e6, Cyrillic_EF)
WARNING: No translation for (keysym 0x6e6, Cyrillic_EF)
прошло >4 часов
/dev/pts/9
11:09:26
$ping 192.168.0.240

11:09:26
$ping 192.168.0.240
200           rdesktop -uol14 -p13r@7t -g1024x768 -a16 -k en-us.fixed 192.168.0.2
WARNING: No translation for (keysym 0xfe0a, ISO_Prev_Group)
WARNING: No translation for (keysym 0x6e3, Cyrillic_TSE)
WARNING: No translation for (keysym 0x6c3, Cyrillic_tse)
WARNING: No translation for (keysym 0x6c5, Cyrillic_ie)
WARNING: No translation for (keysym 0x6c5, Cyrillic_ie)
WARNING: No translation for (keysym 0x6ce, Cyrillic_en)
WARNING: No translation for (keysym 0x6ce, Cyrillic_en)
WARNING: No translation for (keysym 0x6d4, Cyrillic_te)
WARNING: No translation for (keysym 0x6d4, Cyrillic_te)
...
WARNING: No translation for (keysym 0x6e3, Cyrillic_TSE)
WARNING: No translation for (keysym 0x6e3, Cyrillic_TSE)
WARNING: No translation for (keysym 0x6c5, Cyrillic_ie)
WARNING: No translation for (keysym 0x6c5, Cyrillic_ie)
WARNING: No translation for (keysym 0x6ce, Cyrillic_en)
WARNING: No translation for (keysym 0x6ce, Cyrillic_en)
WARNING: No translation for (keysym 0x6d4, Cyrillic_te)
WARNING: No translation for (keysym 0x6d4, Cyrillic_te)
WARNING: No translation for (keysym 0x6d2, Cyrillic_er)
WARNING: No translation for (keysym 0x6d2, Cyrillic_er)

Вторник (08/07/12)

/dev/pts/5
11:32:05
$mlocate utmp.h
/usr/include/utmp.h
/usr/include/bits/utmp.h
11:32:26
$cat /usr/include/utmp.h
/* Copyright (C) 1993, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
   This file is part of the GNU C Library.
   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.
   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.
...
#ifdef  __USE_MISC
/* Reentrant versions of the file for handling utmp files.  */
extern int getutent_r (struct utmp *__buffer, struct utmp **__result) __THROW;
extern int getutid_r (__const struct utmp *__id, struct utmp *__buffer,
                      struct utmp **__result) __THROW;
extern int getutline_r (__const struct utmp *__line,
                        struct utmp *__buffer, struct utmp **__result) __THROW;
#endif  /* Use misc.  */
__END_DECLS
#endif /* utmp.h  */
11:32:50
$cat /usr/include/sys/types.h
/* Copyright (C) 1991,1992,1994,1995,1996,1997,1998,1999,2000,2001,2002,2006
        Free Software Foundation, Inc.
   This file is part of the GNU C Library.
   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.
   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
...
typedef __blkcnt64_t blkcnt64_t;     /* Type to count number of disk blocks. */
typedef __fsblkcnt64_t fsblkcnt64_t; /* Type to count file system blocks.  */
typedef __fsfilcnt64_t fsfilcnt64_t; /* Type to count file system inodes.  */
#endif
/* Now add the thread types.  */
#if defined __USE_POSIX199506 || defined __USE_UNIX98
# include <bits/pthreadtypes.h>
#endif
__END_DECLS
#endif /* sys/types.h */
11:35:41
$cat /usr/include/utmp.h
/* Copyright (C) 1993, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
   This file is part of the GNU C Library.
   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.
   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.
...
#ifdef  __USE_MISC
/* Reentrant versions of the file for handling utmp files.  */
extern int getutent_r (struct utmp *__buffer, struct utmp **__result) __THROW;
extern int getutid_r (__const struct utmp *__id, struct utmp *__buffer,
                      struct utmp **__result) __THROW;
extern int getutline_r (__const struct utmp *__line,
                        struct utmp *__buffer, struct utmp **__result) __THROW;
#endif  /* Use misc.  */
__END_DECLS
#endif /* utmp.h  */
11:42:13
$cat /usr/include/utmp.h |grep _PATH_UTMP
#define UTMP_FILE       _PATH_UTMP
#define UTMP_FILENAME   _PATH_UTMP
11:42:44
$cat /usr/include/bits/utmp.h |grep _PATH_UTMP

11:44:56
$cat /usr/include/bits/utmp.h
/* The `struct utmp' type, describing entries in the utmp file.  GNU version.
   Copyright (C) 1993, 1996, 1997, 1998, 1999, 2002
   Free Software Foundation, Inc.
   This file is part of the GNU C Library.
   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.
   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
...
#define ACCOUNTING      9
/* Old Linux name for the EMPTY type.  */
#define UT_UNKNOWN      EMPTY
/* Tell the user that we have a modern system with UT_HOST, UT_PID,
   UT_TYPE, UT_ID and UT_TV fields.  */
#define _HAVE_UT_TYPE   1
#define _HAVE_UT_PID    1
#define _HAVE_UT_ID     1
#define _HAVE_UT_TV     1
#define _HAVE_UT_HOST   1
11:45:02
$cat /usr/include/utmp.h
/* Copyright (C) 1993, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
   This file is part of the GNU C Library.
   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.
   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.
...
#ifdef  __USE_MISC
/* Reentrant versions of the file for handling utmp files.  */
extern int getutent_r (struct utmp *__buffer, struct utmp **__result) __THROW;
extern int getutid_r (__const struct utmp *__id, struct utmp *__buffer,
                      struct utmp **__result) __THROW;
extern int getutline_r (__const struct utmp *__line,
                        struct utmp *__buffer, struct utmp **__result) __THROW;
#endif  /* Use misc.  */
__END_DECLS
#endif /* utmp.h  */

Среда (08/08/12)

09:31:27
$man more
09:38:09
$Press `Q' to quit, `H' for help, and SPACE to scroll.
__malloc_hook (3)    - malloc debugging variables
bzmore (1)           - file perusal filter for crt viewing of bzip2 compressed text
convert (1)          - convert between image formats as well as resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more.
Date::Manip::TZ::paport00 (3pm) - Support for the Pacific/Port_Moresby time zone
git-merge (1)        - Join two or more development histories together
identify (1)         - describes the format and characteristics of one or more image files.
less (1)             - opposite of more
Log::Dispatch (3pm)  - Dispatches messages to one or more outputs
mergecap (1)         - Merges two or more capture files into one
mogrify (1)          - resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more. Mogrify overwrites the original image file, whereas, convert(1) writes to a ...
...
XkbGetIndicatorMap (3) - Gets the map for one or more indicators, using a mask to specify the indicators
XkbGetKeyboard (3)   - Retrieves one or more components of a keyboard device description
XkbGetKeyModifierMap (3) - Update the modifier map for one or more of the keys in a keyboard description
XkbGetNameChanges (3) - Update the local copy of the keyboard description with the actual values of the results of one or more calls to XkbNoteNameChanges
XkbListComponents (3) - List of components for one or more component types
XkbSelectEvents (3)  - Selects and / or deselects for delivery of one or more Xkb events and has them delivered under all conditions
XkbSetIndicatorMap (3) - Downloads the changes to the server based on modifications to a local copy of the keyboard description which will update the maps for one or more indicators
xmore (1)            - plain text display program for the X Window System
xzmore (1)           - view xz or lzma compressed (text) files
zmore (1)            - file perusal filter for crt viewing of compressed text
09:38:20
$man -k file
09:40:10
$man -k file | grep read
__freadable (3)      - interfaces to stdio FILE structure
__freading (3)       - interfaces to stdio FILE structure
_llseek (2)          - reposition read/write file offset
BIO_read_filename (3ssl) - FILE bio
Config::IniFiles (3pm) - A module for reading .ini-style configuration files.
eventfd_read (3)     - create a file descriptor for event notification
fc-cat (1)           - read font information cache files
fgetwc (3)           - read a wide character from a FILE stream
fgetws (3)           - read a wide-character string from a FILE stream
Font::FreeType (3pm) - read font files and render glyphs from Perl using FreeType2
...
pwrite (2)           - read from or write to a file descriptor at a given offset
pwrite64 (2)         - read from or write to a file descriptor at a given offset
pyexcelerator (1)    - a module for reading/writing Excel spreadsheet files
read (2)             - read from a file descriptor
readahead (2)        - perform file readahead into page cache
readelf (1)          - Displays information about ELF files.
readlink (1)         - print value of a symbolic link or canonical file name
readlinkat (2)       - read value of a symbolic link relative to a directory file descriptor
readprofile (1)      - a tool to read kernel profiling information
tee (1)              - read from standard input and write to standard output and files
09:40:55
$man 2 read
прошло 15 минут
/dev/pts/7
09:56:44
$ping 192.168.0.160
PING 192.168.0.160 (192.168.0.160) 56(84) bytes of data.
64 bytes from 192.168.0.160: icmp_req=1 ttl=128 time=0.254 ms
64 bytes from 192.168.0.160: icmp_req=2 ttl=128 time=0.254 ms
64 bytes from 192.168.0.160: icmp_req=3 ttl=128 time=0.249 ms
^X64 bytes from 192.168.0.160: icmp_req=4 ttl=128 time=0.275 ms
64 bytes from 192.168.0.160: icmp_req=5 ttl=128 time=0.255 ms
^Z
[1]+  Stopped                 ping 192.168.0.160

Понедельник (08/13/12)

/dev/pts/2
05:13:58
$su
Пароль:
su: Сбой при проверке подлинности
/dev/pts/2
05:14:09
$-g1024x768 -a16 -k en-us.fixed 192.168.0.28

05:14:09
$pto8 -p -g1024x768 -a16 -k en-us.fixed 192.168.0.21

прошло 39 минут
/dev/pts/4
05:53:11
$man 2 open
05:59:42
$ устройством терминала, то флаг O_TRUNC игнорируется. В
КРАТКОЕ ОПИСАНИЕ
       ssize_t read(int fd, void *buf, size_t count);
       read()  пытается  читать из файлового дескриптора fd байты в количестве
ОПИÐcount в буфер, начинающийся по адресу buf.
       Если count равен нулю, то read() возвращает ноль и  ничего  не  делает.
       Если count больше, чем SSIZE_MAX, то результат неопределен.
       При  успешном  завершении  возвращается  количество  байт, которые были
ВОЗÐпрочитаны (ноль означает конец файла), а позиция в файле  увеличивается
       на   это  значение.   Если  количество  прочитанных  байт  меньше,  чем
       количество запрошенных, то это не считается ошибкой: например, мы могли
...
       read() был прерван сигналом.  В случае ошибки возвращается -1, а  errno
       устанавливается   должным   образом.    В  этом  случае  позиция  файла
       неопределена.
       прочитаны (ноль означает$
       на   это  значение.   Ес$
       количество запрошенных, $
       читать  вблизи  конца  ф$
       read() был прерван сигна$
       устанавливается   должны$
       неопределена.
/dev/pts/6
06:04:41
$cd ~/C/who1

06:04:49
$ls
who1.c
06:10:17
$./who1

06:10:27
$gcc -o who1 who1.c
who1.c: In function ‘main’:
who1.c:15: error: ‘current_record’ undeclared (first use in this function)
who1.c:15: error: (Each undeclared identifier is reported only once
who1.c:15: error: for each function it appears in.)
/dev/pts/4
06:11:52
$Press `Q' to quit, `H' for help, and SPACE to scroll.

06:12:05
$man -k utmp
06:12:12
$man 5 utmp
06:14:16
$Press `Q' to quit, `H' for help, and SPACE to scroll.
       utmp, wtmp - login records
NAME
SYNOPSIS
       #include <utmp.h>
       The  utmp  file  allows  one to discover information about who is cur‐
DESCRIPTIONly using the system.  There may be more users currently using  the
       system, because not all programs use utmp logging.
       Warning:  utmp must not be writable by the user class "other", because
       many system programs (foolishly) depend on its  integrity.   You  risk
       faked  system  logfiles and modifications of system files if you leave
...
           #define LOGIN_PROCESS 6 /* Session leader process for user login */
           #define USER_PROCESS  7 /* Normal process */
           #define DEAD_PROCESS  8 /* Terminated process */
           #define ACCOUNTING    9 /* Not implemented */
           #define UT_LINESIZE      32
           #define UT_NAMESIZE      32
           #define UT_HOSTSIZE     256
           struct exit_status {              /* Type for ut_exit, below */
Reading...                                                          6,1) 1%
Press `Q' to quit, `H' for help, and SPACE to scroll.
прошло 10 минут
/dev/pts/12
06:24:45
$mc
06:25:20
$mlocate utmp.h
/usr/include/utmp.h
/usr/include/bits/utmp.h
прошло 35 минут
/dev/pts/6
07:00:29
$gcc -o who1 who1.c
who1.c: In function ‘main’:
who1.c:13: error: stray ‘\321’ in program
who1.c:13: error: stray ‘\201’ in program
who1.c:15: error: ‘current_record’ undeclared (first use in this function)
who1.c:15: error: (Each undeclared identifier is reported only once
who1.c:15: error: for each function it appears in.)
/dev/pts/14
07:01:02
$/usr/include/utmp.h
bash: /usr/include/utmp.h: Отказано в доступе
/dev/pts/6
07:02:20
$gcc -o who1 who1.c
who1.c: In function ‘main’:
who1.c:13: error: stray ‘\321’ in program
who1.c:13: error: stray ‘\201’ in program
07:03:19
$gcc -o who1 who1.c

07:03:58
$gcc -o who1 who1.c

07:06:30
$gcc -o who1 who1.c

07:07:03
$gcc -o who1 who1.c

07:07:23
$gcc -o who1 who1.c

07:07:50
$gcc -o who1 who1.c

07:07:57
$gcc -o who1 who1.c
who1.c:12:31: error: fctnl: Нет такого файла или каталога
who1.c: In function ‘main’:
who1.c:19: error: ‘O_RONLY’ undeclared (first use in this function)
who1.c:19: error: (Each undeclared identifier is reported only once
who1.c:19: error: for each function it appears in.)
who1.c:21: warning: incompatible implicit declaration of built-in function ‘exit’
/dev/pts/12
07:10:53
$define INIT_PROCESS 5 /* Process spawned by init(8) */
       read - читает из файлового дескриптора
КРАТКОЕ ОПИСАНИЕ
       #include <unistd.h>
       ssize_t read(int fd, void *buf, size_t count);
ОПИСАНИЕ
       read()  пытается  читать  из файлового дескриптора fd байты в количестве count в буфер,
       Если count равен нулю, то read() возвращает  ноль  и  ничего  не  делает.   Если  count
       больше, чем SSIZE_MAX, то результат неопределен.
       При  успешном  завершении  возвращается  количество  байт, которые были прочитаны (ноль
       означает конец  файла),  а  позиция  в  файле  увеличивается  на  это  значение.   Если
...
                                                                                      4,1) 1
       запрошенных  данных,  вернуть  -1  (устанавливая  errno  в  EINTR)  или  количество уже
       прочитанных байт.
Reading...                                                                            6,1) 3
СООТВЕТСТВИЕ СТАНДАРТАМ
       SVr4, SVID, AT&T, POSIX, X/OPEN, BSD 4.3
ОГРАНИЧЕНИЯ
Reading...                                                                            11,1) 8%
Reading...                                                                            4,1) 2
Reading...
07:13:00
$man -k sizeof
07:13:17
$man -k sizeof()
07:13:47
$man 2 open
прошло 11 минут
/dev/pts/6
07:25:26
$gcc -o who1 who1.c
who1.c:12:31: error: fctnl: Нет такого файла или каталога
who1.c: In function ‘main’:
who1.c:19: error: ‘O_RDONLY’ undeclared (first use in this function)
who1.c:19: error: (Each undeclared identifier is reported only once
who1.c:19: error: for each function it appears in.)
who1.c:21: warning: incompatible implicit declaration of built-in function ‘exit’
07:26:16
$gcc -o who1 who1.c
who1.c:12:33: error: fctnl.h: Нет такого файла или каталога
who1.c: In function ‘main’:
who1.c:19: error: ‘O_RONLY’ undeclared (first use in this function)
who1.c:19: error: (Each undeclared identifier is reported only once
who1.c:19: error: for each function it appears in.)
who1.c:21: warning: incompatible implicit declaration of built-in function ‘exit’
07:29:52
$mlocate fcntl.h
/home/ol14/Desktop/Разное/с рабочего стола/syslin/com32/include/fcntl.h
/home/ol14/Desktop/Разное/с рабочего стола/syslin386/syslinux-3.86/com32/include/fcntl.h
/usr/include/fcntl.h
/usr/include/asm/fcntl.h
/usr/include/asm-generic/fcntl.h
/usr/include/bits/fcntl.h
/usr/include/linux/fcntl.h
/usr/include/sys/fcntl.h
/usr/lib/syslinux/com32/include/fcntl.h
/usr/share/syslinux/com32/include/fcntl.h
/usr/src/linux-headers-2.6.26-2-686/include/asm-x86/fcntl.h
/usr/src/linux-headers-2.6.26-2-686/include/linux/fcntl.h
/usr/src/linux-headers-2.6.26-2-common/include/asm-generic/fcntl.h
/usr/src/linux-headers-2.6.26-2-common/include/asm-x86/fcntl.h
/usr/src/linux-headers-2.6.26-2-common/include/linux/fcntl.h
/usr/src/linux-headers-3.2.0-0.bpo.2-common/arch/x86/include/asm/fcntl.h
/usr/src/linux-headers-3.2.0-0.bpo.2-common/include/asm-generic/fcntl.h
/usr/src/linux-headers-3.2.0-0.bpo.2-common/include/linux/fcntl.h
07:30:34
$cat /usr/include/fcntl.h
/* Copyright (C) 1991,1992,1994-2001,2003,2004,2005,2006,2007,2009,2010,2011
        Free Software Foundation, Inc.
   This file is part of the GNU C Library.
   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.
   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
...
extern int posix_fallocate64 (int __fd, __off64_t __offset, __off64_t __len);
# endif
#endif
/* Define some inlines helping to catch common problems.  */
#if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline \
    && defined __va_arg_pack_len
# include <bits/fcntl2.h>
#endif
__END_DECLS
#endif /* fcntl.h  */
07:30:55
$cat /usr/include/fcntl.h
/* Copyright (C) 1991,1992,1994-2001,2003,2004,2005,2006,2007,2009,2010,2011
        Free Software Foundation, Inc.
   This file is part of the GNU C Library.
   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.
   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
...
extern int posix_fallocate64 (int __fd, __off64_t __offset, __off64_t __len);
# endif
#endif
/* Define some inlines helping to catch common problems.  */
#if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline \
    && defined __va_arg_pack_len
# include <bits/fcntl2.h>
#endif
__END_DECLS
#endif /* fcntl.h  */
07:31:46
$gcc -o who1 who1.c
who1.c: In function ‘main’:
who1.c:21: warning: incompatible implicit declaration of built-in function ‘exit’
07:32:47
$gcc -o who1 who1.c

/dev/pts/12
07:33:17
$НАЗВАНИЕ
_Exit (2)            - завершает текущий процесс
_exit (2)            - завершает текущий процесс
undocumented (2)     - недокументированные системные вызовы
atexit (3)           - register a function to be called at normal process termination
exit (2)             - terminate the calling process
exit (3)             - cause normal process termination
ggCleanupForceExit (3) - Cleanup callback facilities
ggExit (3)           - Initialize and uninitialize LibGG
giiExit (3)          - Initialize and uninitialize LibGII
giiPanic (3)         - Exit LibGII programs for fatal errors
on_exit (3)          - register a function to be called at normal process termination
pthread_exit (3)     - terminate calling thread
07:33:24
$man 2 exit
/dev/pts/6
07:37:14
$gcc -o who1 who1.c

07:39:49
$gcc -o who1 who1.c

/dev/pts/12
07:41:00
$NAME
assert_perror (3)    - test errnum and abort
clnt_perror (3)      - library routines for remote procedure calls
clnt_sperror (3)     - library routines for remote procedure calls
perror (1)           - explain error codes
perror (3)           - print a system error message
/dev/pts/14
07:41:56
$/usr/include/bits/utmp.h
bash: /usr/include/bits/utmp.h: Отказано в доступе
/dev/pts/6
07:44:04
$gcc -o who1 who1.c

/dev/pts/12
07:44:24
$man 1 perror
07:44:50
$Press `Q' to quit, `H' for help, and SPACE to scroll.
       perror - explain error codes
NAME
       perror [options] errorcode ...
SYNOPSIS
       For most system errors, MySQL displays, in addition to an internal text message, the
DESCRIPsystem error code in one of the following styles:
          message ... (errno: #)
          message ... (Errcode: #)
       You can find out what the error code means by examining the documentation for your
       system or by using the perror utility.
...
       To obtain the error message for a MySQL Cluster error code, invoke perror with the
       --ndb option:
          shell> perror --ndb errorcode
       Note that the meaning of system error messages may be dependent on your operating
       system. A given error code may mean different things on different operating systems.
       perror supports the following options:
       ·  --help, --info, -I, -?
          Display a help message and exit.
Reading...
-- MOST: *stdin*                                                                     (1,1) 0%
прошло 10 минут
07:55:14
$Press `Q' to quit, `H' for help, and SPACE to scroll.
       read - читает из файлового дескриптора
НАЗВАНИЕ
       #include <unistd.h>
КРАТКОЕ ОПИСАНИЕ
       ssize_t read(int fd, void *buf, size_t count);
       read()  пытается  читать  из файлового дескриптора fd байты в количестве count в буфер,
ОПИÐначинающийся по адресу buf.
       Если count равен нулю, то read() возвращает  ноль  и  ничего  не  делает.   Если  count
       больше, чем SSIZE_MAX, то результат неопределен.
       При  успешном  завершении  возвращается  количество  байт, которые были прочитаны (ноль
...
       EIO     Ошибка  ввода-вывода.  Это может произойти, например, если процесс, находящийся
               в фоновой группе процессов, пытается  читать  с  контролирующего  терминала,  и
               игнорирует  или  блокирует сигнал SIGTTIN, или же его группа процессов осталась
               без родителя.  Это может также случиться, если произошла низкоуровневая  ошибка
               ввода-вывода при чтения с диска или ленты.
       EISDIR  fd ссылается на каталог.
       EBADF   fd не является допустимым дескриптором файлов или не открыт для чтения.
       EINVAL  fd связан с объектом, неприспособленным для чтения.
       EFAULT  buf указывает за пределы доступного адресного пространства.
-- MOST: *stdin*                                                                     (1,1) 0%
/dev/pts/6
08:01:03
$./who1

08:01:15
$gcc -o who1 who1.c
/tmp/cczWaUkJ.o: In function `main':
who1.c:(.text+0x5c): undefined reference to `show_info'
collect2: ld returned 1 exit status
прошло 96 минут
09:37:51
$gcc -o who1 who1.c
/tmp/ccfRdwPw.o: In function `main':
who1.c:(.text+0x5c): undefined reference to `show_info'
collect2: ld returned 1 exit status
09:43:38
$gcc -o who1 who1.c
who1.c:16: warning: data definition has no type or storage class
who1.c: In function ‘main’:
who1.c:28: error: incompatible type for argument 1 of ‘show_info’
who1.c:16: note: expected ‘struct utmp’ but argument is of type ‘struct utmp *’
who1.c: In function ‘show_info’:
who1.c:32: error: parameter name omitted
09:45:04
$gcc -o who1 who1.c
who1.c: In function ‘main’:
who1.c:28: error: incompatible type for argument 1 of ‘show_info’
who1.c:16: note: expected ‘struct utmp’ but argument is of type ‘struct utmp *’
who1.c: At top level:
who1.c:32: warning: conflicting types for ‘show_info’
who1.c:16: note: previous declaration of ‘show_info’ was here
who1.c: In function ‘show_info’:
who1.c:32: error: parameter name omitted
09:45:30
$gcc -o who1 who1.c

09:46:34
$gcc -o who1 who1.c
who1.c: In function ‘main’:
who1.c:28: error: incompatible type for argument 1 of ‘show_info’
who1.c:16: note: expected ‘struct utmp’ but argument is of type ‘struct utmp *’
who1.c: At top level:
who1.c:32: warning: conflicting types for ‘show_info’
who1.c:16: note: previous declaration of ‘show_info’ was here
09:46:51
$gcc -o who1 who1.c
who1.c:32: warning: conflicting types for ‘show_info’
who1.c:16: note: previous declaration of ‘show_info’ was here
09:47:27
$gcc -o who1 who1.c
who1.c:16: warning: data definition has no type or storage class
09:47:46
$gcc -o who1 who1.c

/dev/pts/12
09:49:01
$Press `Q' to quit, `H' for help, and SPACE to scroll.
       utmp, wtmp - login records
NAME
       #include <utmp.h>
SYNOPSIS
       The  utmp file allows one to discover information about who is currently using the sys‐
DESCRIPtem.  There may be more users currently using the system, because not all programs  use
       utmp logging.
       Warning:  utmp must not be writable by the user class "other", because many system pro‐
       grams (foolishly) depend on its integrity.  You risk faked system logfiles and  modifi‐
       cations of system files if you leave utmp writable to any user other than the owner and
...
           #define USER_PROCESS  7 /* Normal process */
           #define DEAD_PROCESS  8 /* Terminated process */
           #define ACCOUNTING    9 /* Not implemented */
           #define UT_LINESIZE      32
           #define UT_NAMESIZE      32
           #define UT_HOSTSIZE     256
           struct exit_status {              /* Type for ut_exit, below */
               short int e_termination;      /* Process termination status */
               short int e_exit;             /* Process exit status */
-- MOST: *stdin*                                                                     (1,1) 0%
/dev/pts/6
09:50:49
$./who1

09:50:52
$who
ol14     tty7         2012-08-13 08:48 (:0)
ol14     pts/2        2012-08-13 09:14 (:0.0)
ol14     pts/4        2012-08-13 09:53 (:0.0)
ol14     pts/6        2012-08-13 10:04 (:0.0)
ol14     pts/10       2012-08-13 10:24 (:0.0)
ol14     pts/12       2012-08-13 10:24 (:0.0)
ol14     pts/14       2012-08-13 11:01 (:0.0)
09:51:15
$who -a
                        2012-08-11 19:59               417 id=si    терминал=0 выход=0
           cистемная загрузка 2012-08-11 19:59
           уровень выполнения 2 2012-08-11 19:59                   предыдущий=S
                        2012-08-11 20:01              1250 id=l2    терминал=0 выход=0
ВХОД   tty6         2012-08-11 20:01              2630 id=6
ВХОД   tty4         2012-08-11 20:01              2628 id=4
ВХОД   tty2         2012-08-11 20:01              2626 id=2
ВХОД   tty5         2012-08-11 20:01              2629 id=5
ВХОД   tty3         2012-08-11 20:01              2627 id=3
ВХОД   tty1         2012-08-11 20:01              2625 id=1
ol14     - tty7         2012-08-13 08:48 дав      19511 (:0)
           pts/0        2012-08-13 11:29                 0 id=/0    терминал=0 выход=0
ol14     + pts/2        2012-08-13 09:14 00:27       22255 (:0.0)
ol14     + pts/4        2012-08-13 09:53 03:26       25791 (:0.0)
ol14     + pts/6        2012-08-13 10:04   .         25791 (:0.0)
ol14     + pts/10       2012-08-13 10:24 03:26       25791 (:0.0)
ol14     + pts/12       2012-08-13 10:24 00:02       25791 (:0.0)
ol14     + pts/14       2012-08-13 11:01 02:09       25791 (:0.0)
09:51:22
$who
ol14     tty7         2012-08-13 08:48 (:0)
ol14     pts/2        2012-08-13 09:14 (:0.0)
ol14     pts/4        2012-08-13 09:53 (:0.0)
ol14     pts/6        2012-08-13 10:04 (:0.0)
ol14     pts/10       2012-08-13 10:24 (:0.0)
ol14     pts/12       2012-08-13 10:24 (:0.0)
ol14     pts/14       2012-08-13 11:01 (:0.0)
09:56:41
$gcc -o who1 who1.c
who1.c: In function ‘show_info’:
who1.c:41: error: too few arguments to function ‘printf’
09:56:46
$gcc -o who1 who1.c

09:58:23
$./who1
Ошибка сегментирования
09:58:27
$gcc -o who1 who1.c

09:59:29
$./who1
Ошибка сегментирования
09:59:30
$./who1
Ошибка сегментирования
10:00:02
$gcc -o who1 who1.c

10:00:04
$./who1

10:00:05
$gcc -o who1 who1.c

10:01:08
$./who1

10:01:09
$./who1

10:01:50
$gcc -o who1 who1.c

10:02:41
$./who1

10:02:43
$gcc -o who1 who1.c

10:03:04
$./who1

10:03:05
$gcc -o who1 who1.c

10:03:35
$./who1
                  1344693553
reboot   ~        1344693553
runlevel ~        1344693553
                  1344693683
LOGIN    tty6     1344693683
LOGIN    tty4     1344693683
LOGIN    tty2     1344693683
LOGIN    tty5     1344693683
LOGIN    tty3     1344693683
LOGIN    tty1     1344693683
ol14     tty7     1344826101
ol14     pts/0    1344844891
ol14     pts/2    1344827648
ol14     pts/4    1344829989
ol14     pts/6    1344830680
ol14     pts/10   1344831878
ol14     pts/12   1344831884
ol14     pts/14   1344834060
10:03:36
$gcc -o who1 who1.c

10:04:54
$./who1
Ошибка сегментирования
10:04:55
$gcc -o who1 who1.c

10:05:50
$./who1
                  1344693553
reboot   ~        1344693553
runlevel ~        1344693553
                  1344693683
LOGIN    tty6     1344693683
LOGIN    tty4     1344693683
LOGIN    tty2     1344693683
LOGIN    tty5     1344693683
LOGIN    tty3     1344693683
LOGIN    tty1     1344693683
ol14     tty7     1344826101 :0
ol14     pts/0    1344844891 :0.0
ol14     pts/2    1344827648 :0.0
ol14     pts/4    1344829989 :0.0
ol14     pts/6    1344830680 :0.0
ol14     pts/10   1344831878 :0.0
ol14     pts/12   1344831884 :0.0
ol14     pts/14   1344834060 :0.0

Файлы

  • /usr/include/bits/utmp.h
  • /usr/include/fcntl.h
  • /usr/include/sys/types.h
  • /usr/include/utmp.h
  • /usr/include/bits/utmp.h
    >
    /* The `struct utmp' type, describing entries in the utmp file.  GNU version.
       Copyright (C) 1993, 1996, 1997, 1998, 1999, 2002
       Free Software Foundation, Inc.
       This file is part of the GNU C Library.
       The GNU C Library is free software; you can redistribute it and/or
       modify it under the terms of the GNU Lesser General Public
       License as published by the Free Software Foundation; either
       version 2.1 of the License, or (at your option) any later version.
       The GNU C Library is distributed in the hope that it will be useful,
       but WITHOUT ANY WARRANTY; without even the implied warranty of
       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       Lesser General Public License for more details.
       You should have received a copy of the GNU Lesser General Public
       License along with the GNU C Library; if not, write to the Free
       Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
       02111-1307 USA.  */
    #ifndef _UTMP_H
    # error "Never include <bits/utmp.h> directly; use <utmp.h> instead."
    #endif
    #include <paths.h>
    #include <sys/time.h>
    #include <sys/types.h>
    #include <bits/wordsize.h>
    #define UT_LINESIZE     32
    #define UT_NAMESIZE     32
    #define UT_HOSTSIZE     256
    /* The structure describing an entry in the database of
       previous logins.  */
    struct lastlog
      {
    #if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
        int32_t ll_time;
    #else
        __time_t ll_time;
    #endif
        char ll_line[UT_LINESIZE];
        char ll_host[UT_HOSTSIZE];
      };
    /* The structure describing the status of a terminated process.  This
       type is used in `struct utmp' below.  */
    struct exit_status
      {
        short int e_termination;    /* Process termination status.  */
        short int e_exit;           /* Process exit status.  */
      };
    /* The structure describing an entry in the user accounting database.  */
    struct utmp
    {
      short int ut_type;            /* Type of login.  */
      pid_t ut_pid;                 /* Process ID of login process.  */
      char ut_line[UT_LINESIZE];    /* Devicename.  */
      char ut_id[4];                /* Inittab ID.  */
      char ut_user[UT_NAMESIZE];    /* Username.  */
      char ut_host[UT_HOSTSIZE];    /* Hostname for remote login.  */
      struct exit_status ut_exit;   /* Exit status of a process marked
                                       as DEAD_PROCESS.  */
    /* The ut_session and ut_tv fields must be the same size when compiled
       32- and 64-bit.  This allows data files and shared memory to be
       shared between 32- and 64-bit applications.  */
    #if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
      int32_t ut_session;           /* Session ID, used for windowing.  */
      struct
      {
        int32_t tv_sec;             /* Seconds.  */
        int32_t tv_usec;            /* Microseconds.  */
      } ut_tv;                      /* Time entry was made.  */
    #else
      long int ut_session;          /* Session ID, used for windowing.  */
      struct timeval ut_tv;         /* Time entry was made.  */
    #endif
      int32_t ut_addr_v6[4];        /* Internet address of remote host.  */
      char __unused[20];            /* Reserved for future use.  */
    };
    /* Backwards compatibility hacks.  */
    #define ut_name         ut_user
    #ifndef _NO_UT_TIME
    /* We have a problem here: `ut_time' is also used otherwise.  Define
       _NO_UT_TIME if the compiler complains.  */
    # define ut_time        ut_tv.tv_sec
    #endif
    #define ut_xtime        ut_tv.tv_sec
    #define ut_addr         ut_addr_v6[0]
    /* Values for the `ut_type' field of a `struct utmp'.  */
    #define EMPTY           0       /* No valid user accounting information.  */
    #define RUN_LVL         1       /* The system's runlevel.  */
    #define BOOT_TIME       2       /* Time of system boot.  */
    #define NEW_TIME        3       /* Time after system clock changed.  */
    #define OLD_TIME        4       /* Time when system clock changed.  */
    #define INIT_PROCESS    5       /* Process spawned by the init process.  */
    #define LOGIN_PROCESS   6       /* Session leader of a logged in user.  */
    #define USER_PROCESS    7       /* Normal process.  */
    #define DEAD_PROCESS    8       /* Terminated process.  */
    #define ACCOUNTING      9
    /* Old Linux name for the EMPTY type.  */
    #define UT_UNKNOWN      EMPTY
    /* Tell the user that we have a modern system with UT_HOST, UT_PID,
       UT_TYPE, UT_ID and UT_TV fields.  */
    #define _HAVE_UT_TYPE   1
    #define _HAVE_UT_PID    1
    #define _HAVE_UT_ID     1
    #define _HAVE_UT_TV     1
    #define _HAVE_UT_HOST   1
    
    /usr/include/fcntl.h
    >
    /* Copyright (C) 1991,1992,1994-2001,2003,2004,2005,2006,2007,2009,2010,2011
            Free Software Foundation, Inc.
       This file is part of the GNU C Library.
       The GNU C Library is free software; you can redistribute it and/or
       modify it under the terms of the GNU Lesser General Public
       License as published by the Free Software Foundation; either
       version 2.1 of the License, or (at your option) any later version.
       The GNU C Library is distributed in the hope that it will be useful,
       but WITHOUT ANY WARRANTY; without even the implied warranty of
       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       Lesser General Public License for more details.
       You should have received a copy of the GNU Lesser General Public
       License along with the GNU C Library; if not, write to the Free
       Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
       02111-1307 USA.  */
    /*
     *      POSIX Standard: 6.5 File Control Operations     <fcntl.h>
     */
    #ifndef _FCNTL_H
    #define _FCNTL_H        1
    #include <features.h>
    /* This must be early so <bits/fcntl.h> can define types winningly.  */
    __BEGIN_DECLS
    /* Get the definitions of O_*, F_*, FD_*: all the
       numbers and flag bits for `open', `fcntl', et al.  */
    #include <bits/fcntl.h>
    /* For XPG all symbols from <sys/stat.h> should also be available.  */
    #ifdef __USE_XOPEN
    # include <sys/stat.h>
    #endif
    #ifdef  __USE_MISC
    # ifndef R_OK                   /* Verbatim from <unistd.h>.  Ugh.  */
    /* Values for the second argument to access.
       These may be OR'd together.  */
    #  define R_OK  4               /* Test for read permission.  */
    #  define W_OK  2               /* Test for write permission.  */
    #  define X_OK  1               /* Test for execute permission.  */
    #  define F_OK  0               /* Test for existence.  */
    # endif
    #endif /* Use misc.  */
    /* XPG wants the following symbols.  */
    #ifdef __USE_XOPEN              /* <stdio.h> has the same definitions.  */
    # define SEEK_SET       0       /* Seek from beginning of file.  */
    # define SEEK_CUR       1       /* Seek from current position.  */
    # define SEEK_END       2       /* Seek from end of file.  */
    #endif  /* XPG */
    /* Do the file control operation described by CMD on FD.
       The remaining arguments are interpreted depending on CMD.
       This function is a cancellation point and therefore not marked with
       __THROW.  */
    extern int fcntl (int __fd, int __cmd, ...);
    /* Open FILE and return a new file descriptor for it, or -1 on error.
       OFLAG determines the type of access used.  If O_CREAT is on OFLAG,
       the third argument is taken as a `mode_t', the mode of the created file.
       This function is a cancellation point and therefore not marked with
       __THROW.  */
    #ifndef __USE_FILE_OFFSET64
    extern int open (__const char *__file, int __oflag, ...) __nonnull ((1));
    #else
    # ifdef __REDIRECT
    extern int __REDIRECT (open, (__const char *__file, int __oflag, ...), open64)
         __nonnull ((1));
    # else
    #  define open open64
    # endif
    #endif
    #ifdef __USE_LARGEFILE64
    extern int open64 (__const char *__file, int __oflag, ...) __nonnull ((1));
    #endif
    #ifdef __USE_ATFILE
    /* Similar to `open' but a relative path name is interpreted relative to
       the directory for which FD is a descriptor.
       NOTE: some other `openat' implementation support additional functionality
       through this interface, especially using the O_XATTR flag.  This is not
       yet supported here.
       This function is a cancellation point and therefore not marked with
       __THROW.  */
    # ifndef __USE_FILE_OFFSET64
    extern int openat (int __fd, __const char *__file, int __oflag, ...)
         __nonnull ((2));
    # else
    #  ifdef __REDIRECT
    extern int __REDIRECT (openat, (int __fd, __const char *__file, int __oflag,
                                    ...), openat64) __nonnull ((2));
    #  else
    #   define openat openat64
    #  endif
    # endif
    extern int openat64 (int __fd, __const char *__file, int __oflag, ...)
         __nonnull ((2));
    #endif
    /* Create and open FILE, with mode MODE.  This takes an `int' MODE
       argument because that is what `mode_t' will be widened to.
       This function is a cancellation point and therefore not marked with
       __THROW.  */
    #ifndef __USE_FILE_OFFSET64
    extern int creat (__const char *__file, __mode_t __mode) __nonnull ((1));
    #else
    # ifdef __REDIRECT
    extern int __REDIRECT (creat, (__const char *__file, __mode_t __mode),
                           creat64) __nonnull ((1));
    # else
    #  define creat creat64
    # endif
    #endif
    #ifdef __USE_LARGEFILE64
    extern int creat64 (__const char *__file, __mode_t __mode) __nonnull ((1));
    #endif
    #if !defined F_LOCK && (defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \
                                                   && !defined __USE_POSIX))
    /* NOTE: These declarations also appear in <unistd.h>; be sure to keep both
       files consistent.  Some systems have them there and some here, and some
       software depends on the macros being defined without including both.  */
    /* `lockf' is a simpler interface to the locking facilities of `fcntl'.
       LEN is always relative to the current file position.
       The CMD argument is one of the following.  */
    # define F_ULOCK 0      /* Unlock a previously locked region.  */
    # define F_LOCK  1      /* Lock a region for exclusive use.  */
    # define F_TLOCK 2      /* Test and lock a region for exclusive use.  */
    # define F_TEST  3      /* Test a region for other processes locks.  */
    # ifndef __USE_FILE_OFFSET64
    extern int lockf (int __fd, int __cmd, __off_t __len);
    # else
    #  ifdef __REDIRECT
    extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len), lockf64);
    #  else
    #   define lockf lockf64
    #  endif
    # endif
    # ifdef __USE_LARGEFILE64
    extern int lockf64 (int __fd, int __cmd, __off64_t __len);
    # endif
    #endif
    #ifdef __USE_XOPEN2K
    /* Advice the system about the expected behaviour of the application with
       respect to the file associated with FD.  */
    # ifndef __USE_FILE_OFFSET64
    extern int posix_fadvise (int __fd, __off_t __offset, __off_t __len,
                              int __advise) __THROW;
    # else
     # ifdef __REDIRECT_NTH
    extern int __REDIRECT_NTH (posix_fadvise, (int __fd, __off64_t __offset,
                                               __off64_t __len, int __advise),
                               posix_fadvise64);
    #  else
    #   define posix_fadvise posix_fadvise64
    #  endif
    # endif
    # ifdef __USE_LARGEFILE64
    extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len,
                                int __advise) __THROW;
    # endif
    /* Reserve storage for the data of the file associated with FD.
       This function is a possible cancellation points and therefore not
       marked with __THROW.  */
    # ifndef __USE_FILE_OFFSET64
    extern int posix_fallocate (int __fd, __off_t __offset, __off_t __len);
    # else
     # ifdef __REDIRECT
    extern int __REDIRECT (posix_fallocate, (int __fd, __off64_t __offset,
                                             __off64_t __len),
                           posix_fallocate64);
    #  else
    #   define posix_fallocate posix_fallocate64
    #  endif
    # endif
    # ifdef __USE_LARGEFILE64
    extern int posix_fallocate64 (int __fd, __off64_t __offset, __off64_t __len);
    # endif
    #endif
    /* Define some inlines helping to catch common problems.  */
    #if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline \
        && defined __va_arg_pack_len
    # include <bits/fcntl2.h>
    #endif
    __END_DECLS
    #endif /* fcntl.h  */
    
    /usr/include/sys/types.h
    >
    /* Copyright (C) 1991,1992,1994,1995,1996,1997,1998,1999,2000,2001,2002,2006
            Free Software Foundation, Inc.
       This file is part of the GNU C Library.
       The GNU C Library is free software; you can redistribute it and/or
       modify it under the terms of the GNU Lesser General Public
       License as published by the Free Software Foundation; either
       version 2.1 of the License, or (at your option) any later version.
       The GNU C Library is distributed in the hope that it will be useful,
       but WITHOUT ANY WARRANTY; without even the implied warranty of
       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       Lesser General Public License for more details.
       You should have received a copy of the GNU Lesser General Public
       License along with the GNU C Library; if not, write to the Free
       Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
       02111-1307 USA.  */
    /*
     *      POSIX Standard: 2.6 Primitive System Data Types <sys/types.h>
     */
    #ifndef _SYS_TYPES_H
    #define _SYS_TYPES_H    1
    #include <features.h>
    __BEGIN_DECLS
    #include <bits/types.h>
    #ifdef  __USE_BSD
    # ifndef __u_char_defined
    typedef __u_char u_char;
    typedef __u_short u_short;
    typedef __u_int u_int;
    typedef __u_long u_long;
    typedef __quad_t quad_t;
    typedef __u_quad_t u_quad_t;
    typedef __fsid_t fsid_t;
    #  define __u_char_defined
    # endif
    #endif
    typedef __loff_t loff_t;
    #ifndef __ino_t_defined
    # ifndef __USE_FILE_OFFSET64
    typedef __ino_t ino_t;
    # else
    typedef __ino64_t ino_t;
    # endif
    # define __ino_t_defined
    #endif
    #if defined __USE_LARGEFILE64 && !defined __ino64_t_defined
    typedef __ino64_t ino64_t;
    # define __ino64_t_defined
    #endif
    #ifndef __dev_t_defined
    typedef __dev_t dev_t;
    # define __dev_t_defined
    #endif
    #ifndef __gid_t_defined
    typedef __gid_t gid_t;
    # define __gid_t_defined
    #endif
    #ifndef __mode_t_defined
    typedef __mode_t mode_t;
    # define __mode_t_defined
    #endif
    #ifndef __nlink_t_defined
    typedef __nlink_t nlink_t;
    # define __nlink_t_defined
    #endif
    #ifndef __uid_t_defined
    typedef __uid_t uid_t;
    # define __uid_t_defined
    #endif
    #ifndef __off_t_defined
    # ifndef __USE_FILE_OFFSET64
    typedef __off_t off_t;
    # else
    typedef __off64_t off_t;
    # endif
    # define __off_t_defined
    #endif
    #if defined __USE_LARGEFILE64 && !defined __off64_t_defined
    typedef __off64_t off64_t;
    # define __off64_t_defined
    #endif
    #ifndef __pid_t_defined
    typedef __pid_t pid_t;
    # define __pid_t_defined
    #endif
    #if (defined __USE_SVID || defined __USE_XOPEN) && !defined __id_t_defined
    typedef __id_t id_t;
    # define __id_t_defined
    #endif
    #ifndef __ssize_t_defined
    typedef __ssize_t ssize_t;
    # define __ssize_t_defined
    #endif
    #ifdef  __USE_BSD
    # ifndef __daddr_t_defined
    typedef __daddr_t daddr_t;
    typedef __caddr_t caddr_t;
    #  define __daddr_t_defined
    # endif
    #endif
    #if (defined __USE_SVID || defined __USE_XOPEN) && !defined __key_t_defined
    typedef __key_t key_t;
    # define __key_t_defined
    #endif
    #ifdef __USE_XOPEN
    # define __need_clock_t
    #endif
    #define __need_time_t
    #define __need_timer_t
    #define __need_clockid_t
    #include <time.h>
    #ifdef __USE_XOPEN
    # ifndef __useconds_t_defined
    typedef __useconds_t useconds_t;
    #  define __useconds_t_defined
    # endif
    # ifndef __suseconds_t_defined
    typedef __suseconds_t suseconds_t;
    #  define __suseconds_t_defined
    # endif
    #endif
    #define __need_size_t
    #include <stddef.h>
    #ifdef __USE_MISC
    /* Old compatibility names for C types.  */
    typedef unsigned long int ulong;
    typedef unsigned short int ushort;
    typedef unsigned int uint;
    #endif
    /* These size-specific names are used by some of the inet code.  */
    #if !__GNUC_PREREQ (2, 7)
    /* These types are defined by the ISO C99 header <inttypes.h>. */
    # ifndef __int8_t_defined
    #  define __int8_t_defined
    typedef char int8_t;
    typedef short int int16_t;
    typedef int int32_t;
    #  if __WORDSIZE == 64
    typedef long int int64_t;
    #  elif __GLIBC_HAVE_LONG_LONG
    __extension__ typedef long long int int64_t;
    #  endif
    # endif
    /* But these were defined by ISO C without the first `_'.  */
    typedef unsigned char u_int8_t;
    typedef unsigned short int u_int16_t;
    typedef unsigned int u_int32_t;
    # if __WORDSIZE == 64
    typedef unsigned long int u_int64_t;
    # elif __GLIBC_HAVE_LONG_LONG
    __extension__ typedef unsigned long long int u_int64_t;
    # endif
    typedef int register_t;
    #else
    /* For GCC 2.7 and later, we can use specific type-size attributes.  */
    # define __intN_t(N, MODE) \
      typedef int int##N##_t __attribute__ ((__mode__ (MODE)))
    # define __u_intN_t(N, MODE) \
      typedef unsigned int u_int##N##_t __attribute__ ((__mode__ (MODE)))
    # ifndef __int8_t_defined
    #  define __int8_t_defined
    __intN_t (8, __QI__);
    __intN_t (16, __HI__);
    __intN_t (32, __SI__);
    __intN_t (64, __DI__);
    # endif
    __u_intN_t (8, __QI__);
    __u_intN_t (16, __HI__);
    __u_intN_t (32, __SI__);
    __u_intN_t (64, __DI__);
    typedef int register_t __attribute__ ((__mode__ (__word__)));
    /* Some code from BIND tests this macro to see if the types above are
       defined.  */
    #endif
    #define __BIT_TYPES_DEFINED__   1
    #ifdef  __USE_BSD
    /* In BSD <sys/types.h> is expected to define BYTE_ORDER.  */
    # include <endian.h>
    /* It also defines `fd_set' and the FD_* macros for `select'.  */
    # include <sys/select.h>
    /* BSD defines these symbols, so we follow.  */
    # include <sys/sysmacros.h>
    #endif /* Use BSD.  */
    #if defined __USE_UNIX98 && !defined __blksize_t_defined
    typedef __blksize_t blksize_t;
    # define __blksize_t_defined
    #endif
    /* Types from the Large File Support interface.  */
    #ifndef __USE_FILE_OFFSET64
    # ifndef __blkcnt_t_defined
    typedef __blkcnt_t blkcnt_t;     /* Type to count number of disk blocks.  */
    #  define __blkcnt_t_defined
    # endif
    # ifndef __fsblkcnt_t_defined
    typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks.  */
    #  define __fsblkcnt_t_defined
    # endif
    # ifndef __fsfilcnt_t_defined
    typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes.  */
    #  define __fsfilcnt_t_defined
    # endif
    #else
    # ifndef __blkcnt_t_defined
    typedef __blkcnt64_t blkcnt_t;     /* Type to count number of disk blocks.  */
    #  define __blkcnt_t_defined
    # endif
    # ifndef __fsblkcnt_t_defined
    typedef __fsblkcnt64_t fsblkcnt_t; /* Type to count file system blocks.  */
    #  define __fsblkcnt_t_defined
    # endif
    # ifndef __fsfilcnt_t_defined
    typedef __fsfilcnt64_t fsfilcnt_t; /* Type to count file system inodes.  */
    #  define __fsfilcnt_t_defined
    # endif
    #endif
    #ifdef __USE_LARGEFILE64
    typedef __blkcnt64_t blkcnt64_t;     /* Type to count number of disk blocks. */
    typedef __fsblkcnt64_t fsblkcnt64_t; /* Type to count file system blocks.  */
    typedef __fsfilcnt64_t fsfilcnt64_t; /* Type to count file system inodes.  */
    #endif
    /* Now add the thread types.  */
    #if defined __USE_POSIX199506 || defined __USE_UNIX98
    # include <bits/pthreadtypes.h>
    #endif
    __END_DECLS
    #endif /* sys/types.h */
    
    /usr/include/utmp.h
    >
    /* Copyright (C) 1993, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
       This file is part of the GNU C Library.
       The GNU C Library is free software; you can redistribute it and/or
       modify it under the terms of the GNU Lesser General Public
       License as published by the Free Software Foundation; either
       version 2.1 of the License, or (at your option) any later version.
       The GNU C Library is distributed in the hope that it will be useful,
       but WITHOUT ANY WARRANTY; without even the implied warranty of
       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       Lesser General Public License for more details.
       You should have received a copy of the GNU Lesser General Public
       License along with the GNU C Library; if not, write to the Free
       Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
       02111-1307 USA.  */
    #ifndef _UTMP_H
    #define _UTMP_H 1
    #include <features.h>
    #include <sys/types.h>
    __BEGIN_DECLS
    /* Get system dependent values and data structures.  */
    #include <bits/utmp.h>
    /* Compatibility names for the strings of the canonical file names.  */
    #define UTMP_FILE       _PATH_UTMP
    #define UTMP_FILENAME   _PATH_UTMP
    #define WTMP_FILE       _PATH_WTMP
    #define WTMP_FILENAME   _PATH_WTMP
    /* Make FD be the controlling terminal, stdin, stdout, and stderr;
       then close FD.  Returns 0 on success, nonzero on error.  */
    extern int login_tty (int __fd) __THROW;
    /* Write the given entry into utmp and wtmp.  */
    extern void login (__const struct utmp *__entry) __THROW;
    /* Write the utmp entry to say the user on UT_LINE has logged out.  */
    extern int logout (__const char *__ut_line) __THROW;
    /* Append to wtmp an entry for the current time and the given info.  */
    extern void logwtmp (__const char *__ut_line, __const char *__ut_name,
                         __const char *__ut_host) __THROW;
    /* Append entry UTMP to the wtmp-like file WTMP_FILE.  */
    extern void updwtmp (__const char *__wtmp_file, __const struct utmp *__utmp)
         __THROW;
    /* Change name of the utmp file to be examined.  */
    extern int utmpname (__const char *__file) __THROW;
    /* Read next entry from a utmp-like file.  */
    extern struct utmp *getutent (void) __THROW;
    /* Reset the input stream to the beginning of the file.  */
    extern void setutent (void) __THROW;
    /* Close the current open file.  */
    extern void endutent (void) __THROW;
    /* Search forward from the current point in the utmp file until the
       next entry with a ut_type matching ID->ut_type.  */
    extern struct utmp *getutid (__const struct utmp *__id) __THROW;
    /* Search forward from the current point in the utmp file until the
       next entry with a ut_line matching LINE->ut_line.  */
    extern struct utmp *getutline (__const struct utmp *__line) __THROW;
    /* Write out entry pointed to by UTMP_PTR into the utmp file.  */
    extern struct utmp *pututline (__const struct utmp *__utmp_ptr) __THROW;
    #ifdef  __USE_MISC
    /* Reentrant versions of the file for handling utmp files.  */
    extern int getutent_r (struct utmp *__buffer, struct utmp **__result) __THROW;
    extern int getutid_r (__const struct utmp *__id, struct utmp *__buffer,
                          struct utmp **__result) __THROW;
    extern int getutline_r (__const struct utmp *__line,
                            struct utmp *__buffer, struct utmp **__result) __THROW;
    #endif  /* Use misc.  */
    __END_DECLS
    #endif /* utmp.h  */
    

    Статистика

    Время первой команды журнала07:23:58 2012- 8- 1
    Время последней команды журнала10:05:50 2012- 8-13
    Количество командных строк в журнале101
    Процент команд с ненулевым кодом завершения, %20.79
    Процент синтаксически неверно набранных команд, % 0.00
    Суммарное время работы с терминалом *, час 2.66
    Количество командных строк в единицу времени, команда/мин 0.63
    Частота использования команд
    gcc36|==================================| 34.62%
    who114|=============| 13.46%
    man12|===========| 11.54%
    cat9|========| 8.65%
    ping6|=====| 5.77%
    Press6|=====| 5.77%
    who3|==| 2.88%
    grep3|==| 2.88%
    mlocate3|==| 2.88%
    utmp.h2|=| 1.92%
    устройством1|| 0.96%
    pto81|| 0.96%
    define1|| 0.96%
    cd1|| 0.96%
    NAME1|| 0.96%
    НАЗВАНИЕ1|| 0.96%
    ls1|| 0.96%
    -g1024x7681|| 0.96%
    mc1|| 0.96%
    su1|| 0.96%
    ____
    *) Интервалы неактивности длительностью 30 минут и более не учитываются

    Справка

    Для того чтобы использовать LiLaLo, не нужно знать ничего особенного: всё происходит само собой. Однако, чтобы ведение и последующее использование журналов было как можно более эффективным, желательно иметь в виду следующее:
    1. В журнал автоматически попадают все команды, данные в любом терминале системы.

    2. Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.

    3. Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
      $ l s-l
      bash: l: command not found
      

    4. Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
      $ test 5 -lt 4
      Обратите внимание на то, что код завершения команды может быть отличен от нуля не только в тех случаях, когда команда была выполнена с ошибкой. Многие команды используют код завершения, например, для того чтобы показать результаты проверки

    5. Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
      $ find / -name abc
      find: /home/devi-orig/.gnome2: Keine Berechtigung
      find: /home/devi-orig/.gnome2_private: Keine Berechtigung
      find: /home/devi-orig/.nautilus/metafiles: Keine Berechtigung
      find: /home/devi-orig/.metacity: Keine Berechtigung
      find: /home/devi-orig/.inkscape: Keine Berechtigung
      ^C
      

    6. Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
      # id
      uid=0(root) gid=0(root) Gruppen=0(root)
      

    7. Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
      $ vi ~/.bashrc
      2a3,5
      >    if [ -f /usr/local/etc/bash_completion ]; then
      >         . /usr/local/etc/bash_completion
      >        fi
      

    8. Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
      $ patch ~/.bashrc
      В данном случае изменения применяются к файлу ~/.bashrc

    9. Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.

      Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.

    10. Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.

    11. Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора

    12. Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.

    13. Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.

    14. Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:

      $ whoami
      
      user
      
      $ #^ Интересно, кто я?
      
      в журнале это будет выглядеть так:
      $ whoami
      
      user
      
      Интересно, кто я?

    15. Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:

      $ whoami
      
      user
      
      $ cat > /dev/null #^ Интересно, кто я?
      
      Программа whoami выводит имя пользователя, под которым 
      мы зарегистрировались в системе.
      -
      Она не может ответить на вопрос о нашем назначении 
      в этом мире.
      
      В журнале это будет выглядеть так:
      $ whoami
      user
      
      Интересно, кто я?
      Программа whoami выводит имя пользователя, под которым
      мы зарегистрировались в системе.

      Она не может ответить на вопрос о нашем назначении
      в этом мире.
      Для разделения нескольких абзацев между собой используйте символ "-", один в строке.

    16. Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=

    17. Содержимое файла может быть показано в журнале. Для этого его нужно вывести с помощью программы cat. Если вывод команды отметить симоволами #!, содержимое файла будет показано в журнале в специально отведённой для этого секции.
    18. Для того чтобы вставить скриншот интересующего вас окна в журнал, нужно воспользоваться командой l3shot. После того как команда вызвана, нужно с помощью мыши выбрать окно, которое должно быть в журнале.
    19. Команды в журнале расположены в хронологическом порядке. Если две команды давались одна за другой, но на разных терминалах, в журнале они будут рядом, даже если они не имеют друг к другу никакого отношения.
      1
          2
      3   
          4
      
      Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.

    О программе

    LiLaLo (L3) расшифровывается как Live Lab Log.
    Программа разработана для повышения эффективности обучения Unix/Linux-системам.
    (c) Игорь Чубин, 2004-2008

    $Id$