I think I see what you mean now. I was a little confused. You want to use the unix login info for this then?
In this case, like xPlozion said, you'll have to use the password file which is probably in /etc/passwd. If they're in /etc/shadow, then this makes it harder because the user needs the privilege to access this file. You could give all the users this privilege, but that will negate the security gain of having the data stored there.
In any case, you'll need to encrypt(crypt(3) I believe) the password they enter before comparing it to the value in the file. I'm not 100% sure about this part, but if you do a little research I'm sure you'll find the answer.
Once you have the encrypted password, it's as easy as comparing it to the data in the file.