????????? ?????? ? ?????????? Unix SVR4 - PowerPoint PPT Presentation

About This Presentation
Title:

????????? ?????? ? ?????????? Unix SVR4

Description:

Unix SVR4 ( ) . . ... J.Mauro Solaris Internals ... – PowerPoint PPT presentation

Number of Views:97
Avg rating:3.0/5.0
Slides: 14
Provided by: Dmit76
Category:
Tags: internals | svr4 | unix

less

Transcript and Presenter's Notes

Title: ????????? ?????? ? ?????????? Unix SVR4


1
????????? ?????? ? ?????????? Unix SVR4 ????????
(???????????) ??????? ?.?. ??/???
??? ??????????? ?????????? ???? ??????????? ?
?????? ?????????? ????????? ???????? ???-??? ??
2009-2018 ?.?.
2
??????????? ??????????
  • 37 ????? (http//ccfit.nsu.ru/deviv/courses/unix/
    tasks.html)
  • ?? 5 ?????????? ????? 23 ??????, ?? ??? 10 ??
    ?????? ????? ?????
  • ?? 4 11 ?????
  • ?? 3 6 ?????
  • ?????? ???? ??????? ?? ?? Solaris
    (solarka.ccfit.nsu.ru ??? ??????? ??????? ?. ?.
    310).

3
??? ????? Solaris
  • ??, ?????????? ?? ???? Unix System V Release 4.
  • ?????? ????????? ????????????? ATT Unix
  • ??????????????? ????????? Oracle (????? Sun
    Microsystems)
  • ?????????? ???????????? ?????????? x86/x64, SPARC
    v9
  • ???? ?????????? ?????? (?????????? ????????!)
    Solaris Express, ????????? ?? ????? Oracle

4
??? Solaris ?????????? ?? Linux
  • Solaris ??? ?????? )
  • Linux ??????????? ?????? ???? Unix,
    ???????????????? ??? ????????? GPL
  • ??? ??????? ???????????? ????????????????? API
    POSIX/X-Open, ?? Solaris ??????????????, ? Linux
    ???.
  • ??????? ????? ?????? ABI (??????? ????????????)

5
??????????????? ??????????
  • ?. ????????, ?. ????, ?. ??????, ?????????
    ???????????????? ? UNIX. ??????????? ????????????
    ?? ?????????? ?? (???? ? ??????????)
  • ?. ??????????? ???????????? ??????? UNIX
  • ?. ?. ???????, ?. ?. ???? UNIX ????????????????
    ????????????????
  • R. McDougal, J.Mauro Solaris Internals (???
    ???????????)

6
??????????????? ??????????
  • Man(1)
  • ?????????? ????????? ???????????, ???????? ??
    ????????? ?????? ?? ??????? man
  • Oracle Solaris 10/11 documentation
    http//www.oracle.com/technetwork/documentation/so
    laris-10-192992.html , ????. docs.sun.com??? ??
    ???? ? ??? man-???????? ? html c ????????????? ?
    ???????
  • ???????? ?????? http//hg.openindiana.org
  • ??????????? upstream/oracle ??????????????
    ????????????? c???????? OpenSolaris 10/11 ?? 2010
    ???.
  • ?????????? ??????? ????????? ? ????????
    upstream/oracle/onnv-gate

7
man(1)
  • ?????? ??????? man strcpy ??? man -s 2 write
  • ????? ?? ?????????? apropos write
  • ?????? ??????
  • 1 ??????? shell
  • 1M ??????? shell, ????????? ??????????????
  • 2 ????????? ??????
  • 3? ??????????? ?????????? ?

8
?????? ???????? man
  • ????????? (TITLE) - ?????? ??? ????????????
    ??????? ??? ?????????? ??????
  • . ?????? (SECTION) - ?????? ???????????
  • . ?????????? (LIBRARY) - ??? ?????? 3,
    ???????????? ???????, ???? ?? C, S, M, E, X ???
    G.
  • . ??? (NAME) - ??? ? ??????? ????????
    ?????????? ?????? ??? ???????????? ??????? (?
    ????? ??????)
  • . ????????????? (SYNOPSIS) - ??? ???????
    ????????? ?????/???????????? ???????.
  • . ???????? (DESCRIPTION) - ????????? ??????
    ?????????? ?????? ??? ???????.
  • . ???????????? ???????? (RETURN VALUE) - ???
    ???????????????? ???????????? ???.
  • . ??. ????? (SEE ALSO) - ???????? ???????????,
    ??????? ????????? ? ???? ????????.
  • . ???????? (ATTRIBUTES) - ????? ??????????
    ????????????? ???????, thread-safety, ?????????
    ??????? ?????? ? ?.?.
  • ????? ????, ???????? ??????????? ????? ?????????
    ???????
  • . ??????? (EXAMPLES)
  • . ????? (FILES)
  • . ????????? (DIAGNOSTICS)
  • . ????????? (NOTES)
  • . (??????????????) WARNINGS
  • . (??????) BUGS
  • . (????????) CAVEATS

9
?????? ???????? ???????????
  • ???
  • perror - ?????????? ????????? ????????? ??
    ??????
  • ?????????????
  • include ltstdio.hgt
  • void perror(const char s)
  • ????????
  • perror ??????? ? ??????????? ?????
    ??????????? ?????????, ??????????? ?????????
    ??????, ???????????? ??? ?????? ????????? ???
    ???????????? ???????. ??????? ?????????? ??????
    ????????? s, ????? ????????? ? ??????, ?????
    ????????? ? ??????? ??????.
  • ... ????? ?????? ??????? ?? ???????
    ?????????? errno, ??????? ??????????????? ???
    ?????????, ?? ?? ????????? ??? ????????
    ????????? ??????.
  • ??. ?????
  • intro(2), fmtmsg(3C), strerror(3C).

10
?????? ???????? ???????????
  • ???
  • time - ???????? ?????
  • ?????????????
  • include ltsys/types.hgt
  • include lttime.hgt
  • time_t time(time_t tloc)
  • ????????
  • time ?????????? ???????? ??????? ?
    ???????? ?? 1 ?????? 1970, 000000 UTC. ????
    tloc ?? ????? ????, ???????????? ???????? ?????
    ????? ????????? ? ??????????, ?? ???????
    ????????? tloc.
  • ???????????? ????????
  • ??? ???????? ??????????, time ??????????
    ???????? ???????. ????? ???????????? ????????
    -1 ? ???????? errno ???????? ??????? ??????.
  • ??. ?????
  • ctime(3C), stime(2).

11
??????? ????????????? time(2)
  • ??????? ????????????? time(2)
  • . ?????????? ? ?????????????
  • include ltsys/types.hgt
  • include lttime.hgt
  • time_t t1, t2, t3, t4
  • time_t tp t2
  • . ??????? ???????? ????????? time(2) ????????,
    ??? ??????
  • ?????????????? ???????????? ????????
  • t1 time ( 0 )
  • . ?????????????????? ????????? ? ????????
    ?????????
  • t3 time ( tp )
  • . ????? ?????????? ? ???????? ?????????
  • (void) time ( t4 )

12
?????? ???????? ???????????
  • ???
  • ctime, localtime, gmtime, asctime, tzset -
    ?????????????? ???? ? ??????? ? ??????
  • ?????????????
  • include lttime.hgt
  • char ctime(const time_t clock)
  • struct tm localtime(const time_t clock)
  • struct tm gmtime(const time_t clock)
  • char asctime(const struct tm tm)
  • extern time_t timezone, altzone
  • extern int daylight
  • extern char tzname2
  • void tzset(void)
  • ????????
  • ctime, localtime ? gmtime ????????
    ???????? ???? ????????? ?? time_t,
    ?????????????? ????? ? ???????? ? 000000 UTC 1
    ?????? 1970. ctime ?????????? ????????? ??
    ?????? ?? 26 ???????? ?????????? ???? ...
  • Sun Sep 16 010352 1973\n\0

13
?????? ???????? ??????????? (???????????)
  • ... ?????????? ???? ??????? ? ???????
    ??????????, ? ????? ???????? ????????? tm,
    ?????????? ? ????? lttime.hgt. ????????
    ????????? ???????? ???
  • struct tm
  • int tm_sec / seconds after minute
    0,61 /
  • int tm_min / minutes after the hour
    0,59 /
  • int tm_hour / hour since midnight 0,23
    /
  • int tm_mday / day of the month 1,31 /
  • int tm_mon / months since January
    0,11 /
  • int tm_year / years since 1900 /
  • int tm_wday / days since Sunday 0,6 /
  • int tm_yday / days since January 1
    0,365 /
  • int tm_isdst / flag for alternate
    daylight savings time /
Write a Comment
User Comments (0)
About PowerShow.com