LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-28-2009, 11:13 AM   #1
dlinux
Member
 
Registered: Jan 2007
Location: Portugal
Distribution: Slackware 13.0
Posts: 52

Rep: Reputation: 15
Some macros missing


Hello, when trying to use the major(3) and minor(3) macros, gcc does not find them, i have to use the gnu_dev_* aliases.
I just wanted to know if this is some problem on my system or if it's a slack issue.
 
Old 04-28-2009, 03:08 PM   #2
rg3
Member
 
Registered: Jul 2007
Distribution: Fedora
Posts: 527

Rep: Reputation: Disabled
Works for me.

Code:
#define _BSD_SOURCE
#include <stdio.h>
#include <sys/types.h>

int main()
{
	dev_t foo = makedev(10, 10);
	printf("Major: %d\nMinor: %d\n", major(foo), minor(foo));
	return 0;
}
By the way, there's a typo in the manpage for makedev, major and minor. The words "#include" and "#define" are swapped. Maybe the man-pages package maintainer could report it upstream if it's not fixed yet.

Edit: It's present in upstream, verified at: http://www.kernel.org/doc/man-pages/...makedev.3.html

I'll email Michael Kerrisk myself.

Last edited by rg3; 04-28-2009 at 03:14 PM.
 
Old 04-29-2009, 08:49 AM   #3
dlinux
Member
 
Registered: Jan 2007
Location: Portugal
Distribution: Slackware 13.0
Posts: 52

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by rg3 View Post
Works for me.

Code:
#define _BSD_SOURCE
#include <stdio.h>
#include <sys/types.h>

int main()
{
	dev_t foo = makedev(10, 10);
	printf("Major: %d\nMinor: %d\n", major(foo), minor(foo));
	return 0;
}
By the way, there's a typo in the manpage for makedev, major and minor. The words "#include" and "#define" are swapped. Maybe the man-pages package maintainer could report it upstream if it's not fixed yet.

Edit: It's present in upstream, verified at: http://www.kernel.org/doc/man-pages/...makedev.3.html

I'll email Michael Kerrisk myself.
Thanks for the reply.
The problem was one of my include files.
I saw that typo and reported it before creating this thread, but i guess two e-mails won't hurt.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NEdit macros theonebeyond Linux - Software 2 05-29-2018 06:04 PM
Macros in openoffice automata Linux - Software 5 02-21-2009 06:32 AM
Macros In C drumstick Programming 8 11-21-2005 04:37 PM
Macros Twi7ch Linux - General 2 08-27-2005 09:37 PM
macros file newbielinux Linux - Newbie 1 03-01-2004 11:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration