Strona 1 z 2

Man gettimeofday - brak podręcznika dla gettimeofday. Co zrobić aby komenda działała?

: 14 paź 2010, 19:14
autor: p69d
Witam.

Tak jak w temacie. W terminalu chciałem wywołać komendę "man gettimeofday" i po tym wyskoczył mi komunikat "brak podręcznika dla gettimeofday". Powiedzcie mi zrobić aby ta komenda działa. Proszę również nie kasować tego tematu ponieważ jest mi to potrzebne do szkoły muszę napisać program, który będzie odwoływał się do tej komendy :/ ...

Odp: Man gettimeofday - brak podręcznika dla gettimeofday. Co zrobić aby komenda dzia

: 14 paź 2010, 19:37
autor: Dwimenor

Kod: Zaznacz cały

sudo apt-get install gettimeofday

Odp: Man gettimeofday - brak podręcznika dla gettimeofday. Co zrobić aby komenda dzia

: 14 paź 2010, 19:40
autor: p69d
"nie udało się odnaleźć pakietu gettimeofday" ... nie działa Twój sposób :/

Odp: Man gettimeofday - brak podręcznika dla gettimeofday. Co zrobić aby komenda dzia

: 14 paź 2010, 19:54
autor: norvoles
A co to jest to 'gettimeofday'?

Odp: Man gettimeofday - brak podręcznika dla gettimeofday. Co zrobić aby komenda dzia

: 14 paź 2010, 20:01
autor: p69d
man gettimeofday To funkcja systemowa zwracająca bieżący czas mierzony w sekundach i mikrosekundach. Jakkolwiek zależy ona od rozdzielczości zegara systemowego, którego dokładność może być ograniczona (zegar systemowy przechowuje czas, który nie koniecznie musi dokładnie odpowiadać cyklom zegara sprzętowego).

Odp: Man gettimeofday - brak podręcznika dla gettimeofday. Co zrobić aby komenda dzia

: 14 paź 2010, 20:11
autor: norvoles
http://souptonuts.sourceforge.net/code/ ... day.c.html ?

Co prawda nie komenda, ale przykład zastosowania w C, o ile o to w ogóle chodzi.

Odp: Man gettimeofday - brak podręcznika dla gettimeofday. Co zrobić aby komenda dzia

: 14 paź 2010, 20:13
autor: JSokol
U mnie ten manual się otwiera, poniżej jest jego zawartość:

Kod: Zaznacz cały

GETTIMEOFDAY(2)                                   Linux Programmer's Manual                                  GETTIMEOFDAY(2)

NAME
       gettimeofday, settimeofday - get / set time

SYNOPSIS
       #include <sys/time.h>

       int gettimeofday(struct timeval *tv, struct timezone *tz);
       int settimeofday(const struct timeval *tv, const struct timezone *tz);

   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):

       settimeofday(): _BSD_SOURCE

DESCRIPTION
       The functions gettimeofday() and settimeofday() can get and set the time as well as a timezone.  The tv argument is a
       struct timeval (as specified in <sys/time.h>):

           struct timeval {
               time_t      tv_sec;     /* seconds */
               suseconds_t tv_usec;    /* microseconds */
           };

       and gives the number of seconds and microseconds since the Epoch (see time(2)).  The tz argument is  a  struct  time‐
       zone:

           struct timezone {
               int tz_minuteswest;     /* minutes west of Greenwich */
               int tz_dsttime;         /* type of DST correction */
           };

       If either tv or tz is NULL, the corresponding structure is not set or returned.

       The  use of the timezone structure is obsolete; the tz argument should normally be specified as NULL.  The tz_dsttime
       field has never been used under Linux; it has not been and will not be supported by libc or glibc.   Each  and  every
       occurrence  of  this field in the kernel source (other than the declaration) is a bug.  Thus, the following is purely
       of historic interest.

       The field tz_dsttime contains a symbolic constant (values are given below) that indicates in which part of  the  year
       Daylight Saving Time is in force.  (Note: its value is constant throughout the year: it does not indicate that DST is
       in force, it just selects an algorithm.)  The daylight saving time algorithms defined are as follows :

           DST_NONE     /* not on dst */
           DST_USA      /* USA style dst */
           DST_AUST     /* Australian style dst */
           DST_WET      /* Western European dst */
           DST_MET      /* Middle European dst */
           DST_EET      /* Eastern European dst */
           DST_CAN      /* Canada */
           DST_GB       /* Great Britain and Eire */
           DST_RUM      /* Rumania */
           DST_TUR      /* Turkey */
           DST_AUSTALT  /* Australian style with shift in 1986 */

       Of course it turned out that the period in which Daylight Saving Time is in force cannot be given by a  simple  algo‐
       rithm,  one  per  country; indeed, this period is determined by unpredictable political decisions.  So this method of
       representing timezones has been abandoned.  Under Linux, in a call to settimeofday() the tz_dsttime field  should  be
       zero.

       Under  Linux  there are some peculiar "warp clock" semantics associated with the settimeofday() system call if on the
       very first call (after booting) that has a non-NULL tz argument, the tv argument is NULL and the tz_minuteswest field is  nonzero.  In such a case it is assumed that the CMOS clock is on local time, and that it has to be incremented by
       this amount to get UTC system time.  No doubt it is a bad idea to use this feature.

       Macros for operating on timeval structures are described in timeradd(3).

RETURN VALUE
       gettimeofday() and settimeofday() return 0 for success, or -1 for failure (in which case errno is set appropriately).

ERRORS
       EFAULT One of tv or tz pointed outside the accessible address space.

       EINVAL Timezone (or something else) is invalid.

       EPERM  The calling process has insufficient privilege to call settimeofday(); under Linux the CAP_SYS_TIME capability
              is required.

CONFORMING TO
       SVr4,  4.3BSD.   POSIX.1-2001  describes gettimeofday() but not settimeofday().  POSIX.1-2008 marks gettimeofday() as
       obsolete, recomending the use of clock_gettime(2) instead.

NOTES
       Traditionally, the fields of struct timeval were of type long.

SEE ALSO
       date(1), adjtimex(2), time(2), ctime(3), ftime(3), capabilities(7), time(7)

COLOPHON
       This page is part of release 3.24 of the Linux man-pages project.  A description  of  the  project,  and  information
       about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/.

Linux                                                    2009-03-25                                          GETTIMEOFDAY(2)

Odp: Man gettimeofday - brak podręcznika dla gettimeofday. Co zrobić aby komenda dzia

: 14 paź 2010, 20:21
autor: p69d
muszę to ściągnąć z tego linku co podałeś http://prdownloads.sourceforge.net/cpea ... z?download ??

Odp: Man gettimeofday - brak podręcznika dla gettimeofday. Co zrobić aby komenda dzia

: 14 paź 2010, 20:46
autor: dawwin
Instalujesz paczkę z tego źródła
http://www.kernel.org/pub/linux/docs/man-pages/
I już masz

Odp: Man gettimeofday - brak podręcznika dla gettimeofday. Co zrobić aby komenda dzia

: 14 paź 2010, 20:50
autor: p69d
ok ale jak ja chcę aby sama ona mi działa bo muszę to wykonać i zrobić ScreenShot i dołączyć do pracy to co wtedy?

Odp: Man gettimeofday - brak podręcznika dla gettimeofday. Co zrobić aby komenda dzia

: 14 paź 2010, 20:54
autor: dawwin
Jak jej nie ma w systemie to z powietrza się nie weźmie. Ściągasz paczkę z linka, który podałem Ci post wyżej i wtedy będzie działać. Może da się ją też pobrać z repozytoriów, ale nie wiem, jak się tam nazywa.
Jak już ją zainstalujesz to będziesz miał tę komendę i setki innych

Odp: Man gettimeofday - brak podręcznika dla gettimeofday. Co zrobić aby komenda dzia

: 14 paź 2010, 21:43
autor: p69d
a no i o to upewnienie mi chodziło dzięki wielkie :D ... jak się uda to napiszę.

EDIT:
ok ściągnąłem tą paczkę ale jak ją zainstalować?

Odp: Man gettimeofday - brak podręcznika dla gettimeofday. Co zrobić aby komenda dzia

: 14 paź 2010, 21:49
autor: dawwin
Rozpakowujesz archiwum, otwierasz terminal, wchodzisz w rozpakowany katalog i wykonujesz polecenie

Kod: Zaznacz cały

make install
(bez ./configure i make)
I to chyba na tyle

Odp: Man gettimeofday - brak podręcznika dla gettimeofday. Co zrobić aby komenda dzia

: 14 paź 2010, 21:50
autor: p69d
zaraz sprawdzę.

Odp: Man gettimeofday - brak podręcznika dla gettimeofday. Co zrobić aby komenda dzia

: 14 paź 2010, 21:55
autor: norvoles
O ile się nie mylę, to ta paczka jest w repo:

Kod: Zaznacz cały

sudo apt-get install manpages-cs

Odp: Man gettimeofday - brak podręcznika dla gettimeofday. Co zrobić aby komenda dzia

: 14 paź 2010, 22:12
autor: dawwin
norvoles pisze:O ile się nie mylę, to ta paczka jest w repo:

Kod: Zaznacz cały

sudo apt-get install manpages-cs
Chyba jednak nie :)

Kod: Zaznacz cały

$ sudo apt-cache search manpages-cs
manpages-cs - Czech version of the manual pages

Odp: Man gettimeofday - brak podręcznika dla gettimeofday. Co zrobić aby komenda dzia

: 14 paź 2010, 22:17
autor: norvoles
@up
Racja, racja, mój brak czytania ze zrozumieniem się kłania :bag:
ale fail...

Odp: Man gettimeofday - brak podręcznika dla gettimeofday. Co zrobić aby komenda dzia

: 14 paź 2010, 22:55
autor: p69d
dawwin pisze:Rozpakowujesz archiwum, otwierasz terminal, wchodzisz w rozpakowany katalog i wykonujesz polecenie

Kod: Zaznacz cały

make install
(bez ./configure i make)
I to chyba na tyle
"brak reguł do wykonania obiektu 'install'. Stop." co teraz :)?

Odp: Man gettimeofday - brak podręcznika dla gettimeofday. Co zrobić aby komenda dzia

: 14 paź 2010, 23:06
autor: dawwin
Teraz proponowałbym przejść w terminalu do katalogu, w którym masz rozpakowane archiwum i dopiero wykonać polecenie 'make install'
Użyj do tego magicznego polecenia

Kod: Zaznacz cały

cd [katalog]
Bo zakładam, że pobrałeś paczkę man-pages-3.28.tar.gz

Odp: Man gettimeofday - brak podręcznika dla gettimeofday. Co zrobić aby komenda dzia

: 14 paź 2010, 23:18
autor: p69d
Ok ale jak wejde do katalogu kliknę PPM i zrobię Otwórz w Terminalu to nie muszę przechodzić przecież :)