Date: Sat, 26 Dec 2009 23:21:55 +0530 From: Manish Jain <invalid.pointer@gmail.com> To: freebsd-questions@freebsd.org Subject: Re: freebsd-questions Digest, Vol 290, Issue 12 Message-ID: <4B364D3B.4030504@gmail.com> In-Reply-To: <20091226120027.952D110656CE@hub.freebsd.org> References: <20091226120027.952D110656CE@hub.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Hello, I am looking a convenient way using C to retrieve the current CPU and memory utilization of a process of which I have the pid. Can somebody please give me a hint of which system-calls/library-functions to use for this ? I don't want to use the system() function or grep for information via the /proc filesystem. I would be grateful if you could also please mention whether the suggested method[s] is/are FreeBSD-specific or would be portable to other environments like Solaris/Linux ? Thanks for any help. Regards & Happy New Year Manish Jain invalid.pointer@gmail.com freebsd-questions-request@freebsd.org wrote: > Send freebsd-questions mailing list submissions to > freebsd-questions@freebsd.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > or, via email, send a message with subject or body 'help' to > freebsd-questions-request@freebsd.org > > You can reach the person managing the list at > freebsd-questions-owner@freebsd.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of freebsd-questions digest..." > > > Today's Topics: > > 1. setlocale command is missing (Daniel Dvo??k) > 2. Re: clicky driver (Roland Smith) > 3. Package Dependency Issue (Joseph L. Casale) > 4. Re: setlocale command is missing (Rolf G Nielsen) > 5. Fwd: location of discussion of livefs > (leeoliveshackelford@surewest.net) > 6. Failed port upgrade (Rem P Roberti) > 7. Re: freebsd for children (Ian Smith) > 8. Re: clicky driver (Gary Kline) > 9. Re: clicky driver (Gary Kline) > 10. portaudit php vulnerabilities (Aleksandr Miroslav) > 11. Re: Firefox 3.5 and Epiphany crashing since the GNOME 2.28 > update (Neil Short) > 12. Re: portaudit php vulnerabilities (Nerius Landys) > 13. ANNOUNCE: 64 bit 8.0-RELEASE-p1 Custom XFCE build available > (Manolis Kiagias) > 14. Re: freebsd for children (Dh?nin Jean-Jacques) > 15. Punam Chowhan sent you a private message on Feed Share - > please respond (Punam Chowhan) > 16. Re: location of discussion of lives (Matthew Seaman) > 17. Re: clicky driver (Matthew Seaman) > 18. Re: Wireless USB adapter (Paul B Mahol) > 19. Re: clicky driver (Nick Barnes) > 20. Re: Upgrade 7.0 to 7.2 installworld failed - SOLVED (Colin) > 21. Re: Firefox 3.5 and Epiphany crashing since the GNOME 2.28 > update (Anh Ky Huynh) > 22. Re: portaudit php vulnerabilities (Jerry) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sat, 26 Dec 2009 02:04:44 +0100 > From: Daniel Dvo??k <dandee@hellteam.net> > Subject: setlocale command is missing > To: <freebsd-questions@freebsd.org> > Message-ID: <9FFCA7E178C44C10994E4C52AC40EDA4@tocnet28.jspoj.czf> > Content-Type: text/plain; charset="utf-8" > > Hi, > > I updated a mc port to the last one, version 4.7.0pre4 and wanted to run mc, but mc display a warning message that the selected display charset or source codeset does not match one set via locale. I have never seen this message since I am a user of mc. Propably it is something new in this new version. The version 4.6.2 does not show you this message durring starting application. > > I wanted to set my locale, but I found out that command setlocale is missing on FreeBSD 7.2. > > Files in directory /etc: > > login.conf, login.conf.db, csh.login and profile are set as HANDBOOK recommends for language localization. > > My shells are bash, tcsh or zsh, csh for root user. The results are the same. > > bash: > [user@server ~]$ LC_ALL=ISO-8859-2; export LC_ALL > -bash: varování: setlocale: LC_ALL: cannot change locale (ISO-8859-2): No such file or directory > > zsh: > server% setlocale LC_ALL ISO-8859-2 > zsh: command not found: setlocale > > tcsh: > >> setlocale LC_ALL ISO-8859-2 >> > setlocale: Command not found. > > root csh: > server# setlocale LC_ALL ISO-8859-2 > setlocale: Command not found. > > So my simple question is why is setlocale command missing in FreeBSD 7.2 ? And if user could not use locale and setlocale commands like on Linux, how can I solve my problem with new version of MC ? > > The mc message: > > Confirmation > > Chosen display charset (Settings->Display bits) or source codeset (in mcedit ctrl-t) does not match one set via locale. Set correct codeset manually or press <<Fix it>> to set locale default. > > Or set 'don' task again' and press <<Skip>> > > [ ] don't ask again > > [< Fix it >] [ Skip ] > > BTW in mc there is not any settings with display bits, there is only options menu with display bits. Wrong help dialogs ? > > Thank you > > Daniel > > > > > ------------------------------ > > Message: 2 > Date: Sat, 26 Dec 2009 02:43:56 +0100 > From: Roland Smith <rsmith@xs4all.nl> > Subject: Re: clicky driver > To: Gary Kline <kline@thought.org> > Cc: FreeBSD Mailing List <freebsd-questions@freebsd.org> > Message-ID: <20091226014356.GB10072@slackbox.xs4all.nl> > Content-Type: text/plain; charset="us-ascii" > > On Fri, Dec 25, 2009 at 12:47:49PM -0800, Gary Kline wrote: > >> Nothing tactile, and because neither Linux nor BSD has an audio >> "click", not even that. Sun does have a command line >> > > It should. The X window system provides a way to get keyclicks with > xset(1). The command 'xset c 100' whould generate the loudest click possible. > > Whether you hear something depends e.g. on how the X server is started, and > wether the hardware supports it. On my PC I hear the 'bell' from the PC > speaker, but no clicks. > > Roland >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B364D3B.4030504>