curunreservedpgs( db_id, lstart, default_value )
Returns the number of free pages on the device fragment starting at logical page lstart. Basically, this is the same as the column ‘unreservedpgs’ in the table master.dbo.sysusages.
unreservedpgs
master.dbo.sysusages