tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: Eyal Rif <EYALRI () amdocs ! com>
To: tru64-unix-managers
Subject: getting parameters from /dev/kmem using lseek
Date: Mon, 06 Dec 1999 18:33:31 +0000	[thread overview]
Message-ID: <96079091516178.tru64-unix-managers.marc@archive.invalid> (raw)

Greeting all,

Here is a question regarding programming
When I use nm on the /vmunix I get a lot of parameters
When I try to find these value in /dev/kmem
using the lseek command in c I get a message that
this parameter can't be found.
I suspect that the problem is with the size of the parameter pagesize
I have a source code of vmubc which uses
the exact thing with different parameters but there it work
here is the code I compiled and trying to run



static int kmem;

int pagesize;

main()
{
    int a,new,new1;
    if ((kmem = open(_PATH_KMEM, O_RDONLY)) < 0) {
                perror(_PATH_KMEM);
                exit(1);
        }
    if (lseek(kmem, (long) nl[N_PAGE_SIZE].n_value, SEEK_SET) !=
            (long) nl[N_PAGE_SIZE].n_value) {
                perror("pagesize; lseek");
        } else
          if (read(kmem, &pagesize, sizeof(pagesize)) !=
                    sizeof(pagesize)) {
                        perror("pagesize; read");
                }

     new = pagesize;
     printf("page size is: %d\n",new);

} 

                 reply	other threads:[~1999-12-06 18:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox